Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Custom Sort Description Sort a list of integers basis the remainder they leave when divided by 5 in an ascending order, i . e .
Custom Sort
Description
Sort a list of integers basis the remainder they leave when divided by in an ascending order, ie the number that leaves a lower remainder when divided by should come before the number which leaves a higher remainder.
Hint: Use the appropriate key in the sorted function. If two integers leave the same remainder then their order as in the original list should be preserved.
Examples:
Input :
Output :
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started