Google interviews problems solution and Problem
Explanation of the problem statements
Format to take the input
Format of the output
Understand the format of the output
Explanation of the output:
How to solve the problem using my personal method
- Analyze the problem
- Take the input from the user
- Apply the logic to solve the problem
- Print the output
Steps of the program:
- First, we will take the number of test cases.
- Then we will run the while loop according to the test cases.
- Then we will take the length of the list and sums that we want to output.
- Then we will separate the length(size) and Sum.
- Then we will take the list from the user.
- Then we will check the subarray and check is equal to the given sum or not.
- If they equal to the given sums then we will print the location of the subarray.
- And if it is not equal to this or greater than the given sum we will start the sums of the subarray from the 2 elements.
- After when the one test cases will close then we will minus the 1 number from the test cases.