filmov
tv
Split the array into two , 1st contains the sum of n-1 numbers, 2nd array with all the n-1 elements.
Показать описание
Problem : Given an array of numbers, split the array into two where one array contains the sum of n-1 numbers and the other array with all the n-1 elements.
Input : {3,7,11,1}
output : { 3,7,1} , {11}
Time Complexity : n
Space Complexity : no extra space
Input : {3,7,11,1}
output : { 3,7,1} , {11}
Time Complexity : n
Space Complexity : no extra space