You are viewing a single comment's thread. Return to all comments →
I was nitpicking, I thought of the same soln at first but then changed my mind;
As the question was GIVEN an array ..so if this was an interview there is this constraint that your array is already populated with the elements.
btw r u 14 ? its great to see my young indian frnds indulging in programing