Informatica Coding Round Question


Given an array with n elements and an integer k. Divide the array into subarrays, each of them containing k ekements.For example:
Input: arr[]={1, 32, 5, 6, 9, 3} and k=2

The subarrays will have elements

{132}, {56}, {93}.



Now sort these subarrays as {56}, {93}, {132}. Merge these subarrays together and display them as the elements of original array in sorted order as

Final output: arr[]={5, 6, 9, 3, 1, 32}
Examples:

Input : arr[]={1, 32, 5, 6, 9, 3} and k=2 
Output : arr[]={5, 6, 9, 3, 1, 32}

Solution Link: https://ide.geeksforgeeks.org/Q1MnSYRlPP


Write your Interview Experience or mail it to contribute@geeksforgeeks.org



My Personal Notes arrow_drop_up

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.