DXC Technology SHL OA 2026 | Maximum Length Target Sum Subarray & Array Inversion Count

Question · Posted Jun 2026

Problem 1 - Maximize Subarray Target Sum Problem Statement You are given an integer array nums of size N and a target value K. Find the maximum length of a contiguous subarray whose sum is exactly equal to K. If no such subarray exists, return 0. Constraints Constraint 1 ≤ N ≤ 100000 -109 ≤ nums[i] ≤ 109 -109 ≤ K ≤ 109 Test Cases Input Output Explanation nums = [1, -1, 5, -2, 3], K = 3 4 The ...

The full answer & interview discussion are available to premium members.

Log in Create a free account