1. Sort array after converting elements to their squares Input : arr[] = {-6, -3, -1, 2, 4, 5} Output : 1, 4, 9, 16, 25, 36
Anonymous
1. Question 1 Approach 1: Did using 2 pointer approach. Compare the the absolute values of 1st and last element and place the square on correct position. I've also discussed 2 other approaches. Corrected the interviewer for the time complexity.
Check out your Company Bowl for anonymous work chats.