Company: Texas

Difficulty: medium

Problem Statement

Longest Subarray With Sum K Given an integer array and integer `K`, find the greatest length of a contiguous subarray whose sum equals `K`. Print `0` if none exists. Input Format The first line contains `n` and `K`. The second line contains `n` integers. Output Format Print the maximum length. Constraints `1 <= n <= 2*10^5`; array values and `K` fit in signed 64-bit integers.

More Texas OA questionsInterview experiences