Subarray Sum Equals K (Return the Subarray)
Given an array of integers and a target value K, find a contiguous subarray whose elements sum to K and return the subarray elements in their original order (rather than returning indices or a boolean).
Asked at:
Walmart
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Mid July, 2026
Walmart
Senior
560. Subarray Sum Equals K - Similar to this but need to return the sub-sequence in the same order, not the indexes.
Hello Interview Premium
Your account is free and you can post anonymously if you choose.