Asked inAmazon,Sde1

Sub set problem(Check if there exists any sub array with given sum in the array ) . But the thing here is that we have to do it with space complexity of only O( 1 K ) . K is the sum given .

AnswerBot
1y

Check if there exists any sub array with given sum in the array with O(1K) space complexity.

  • Use two pointers to traverse the array and maintain a current sum.

  • If the current sum is greater than the giv...read more

Sandeep Agrahari
5y

Given an unsorted array of nonnegative integers, find a continuous subarray which adds to a given number.

Examples :

Input: arr[] = {1, 4, 20, 3, 10, 5}, sum = 33Ouptut: Sum found between indexes 2 an...read more

Help your peers!
Add answer anonymously...
Amazon Sde1 Interview Questions
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+

Reviews

4 L+

Interviews

4 Cr+

Salaries

1 Cr+

Users/Month

Contribute to help millions
Get AmbitionBox app

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter