Morgan Stanley interview

Anonymous User
1247
Jun 09, 2022
Jun 09, 2022

For a given interger array, find two subarray of size 2 whose sum is equal.
For example,
input :
int[] inputArr = {1,2,3,4,5};
output :
{1,4} and {2,3} as some of both these array is 5.

Can anyone help me solve this?

Comments (4)