![]() |
VOOZH | about |
The arrays roll[] and marks[] store student roll numbers and their corresponding marks. The objective is to reorder the roll numbers such that they follow the descending order of marks, while maintaining the correct roll-marks association.
Example:
Input: roll[] = {101, 108, 103, 105}, marks[] = {70, 80, 40, 90}
Output: {105, 108, 101, 103}
Explanation: After sorting marks[] in decreasing order as {90, 80, 70, 40}, the corresponding roll[] values are rearranged to {105, 108, 101, 103} respectively.
Follow these steps to solve the problem efficiently:
105 108 101 103