@BALARUKESH
i think the problem is to maximize the diffrence j-i according to condition
and in your solution j can be less than i.

This problem can be solved by sorting the array first, then taking
diffrence.
this solution is done in O(nlogn).

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
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