@atul.. let me tell you ., i told that we can send 

u took two array 
 arr[]={2,0,0,0}
 arr2[]={2,-2,1,0};

take 2 as a base in 1st array  , calculate sum (exclduing 2 ), calculate 
base^arr[i] that gives  sum1= 3
sorting not allowed , just search linearly 2 in 2nd array e.g. search the 
same element which u taken as base in 1st array , inside the 2nd array.
if not found , you can simply return they won't be similar else take the 
same number as base calculate base^arr2[i]  .isn't the sum2 will be  
3....ohh yes it won't be as. 3+1/4 will result integer addition as 3 , as 
you figured out if take same float it may handle the issue.

so in think problem will arise when when we have -ive numbers ...So 
@Atul....Good Work... Will Post if found improvement in the solution ?

@all ...so still we didn't get correct solution of this question in linear 
time O(n) or O(nlogn) ..correct ?

Thanks
Shashank Mani 
Computer Science
Birla Institute of Technology,Mesra


-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/algogeeks/-/BxT8qKdW-y8J.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to