Rearrange array elements. Given an array ‘A’ having ‘N’ integers and an integer ‘m’. You need to rearrange the array elements such that after re-arrangement difference of array elements with ‘m’ should be in a sorted fashion. If the difference between any two array elements and ‘m’ is the same, then the element which c...
read more
CodingNinjas
author
2y
A direct approach would be to use an additional empty array of size n, where n is the size of the input array. Manage two pointers, one at the starting index of the input array and another one at the ...
see more
CodingNinjas
author
2y
Brute Force ApproachWe will solve this problem by finding the array elements that will give the minimum difference between the array element and ‘ m ‘.We will maintain an array ‘visited’ where visited...
see more
CodingNinjas
author
2y
Multimap ImplementationWe can solve this problem by using a multimap.Multimap is similar to a map with an addition that in multimap, multiple elements can have the same key. Multimap also stores all t...
see more
Add answer anonymously...
Top Info Edge Software Developer interview questions & answers
Popular interview questions of Software Developer
Top HR questions asked in Info Edge Software Developer
Stay ahead in your career. Get AmbitionBox app
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+
Reviews
4 L+
Interviews
4 Cr+
Salaries
1 Cr+
Users/Month
Contribute to help millions
Get AmbitionBox app