Company: deloitte_26aug
Difficulty: medium
Tens Digit Sort Problem Description Sorting seems to be a big topic right now, so Shubha decides to create her own kind of sorting. Since she can't really code, she asks you to help to design the program for the same. Shubha's sorting algorithm goes like this: She sorts the numbers by their ten's digits in ascending order but if two numbers have the same ten's digit then the bigger number is printed first. Write a program to print all the numbers after sorting. Read the input from STDIN and print the output to STDOUT. Do not print arbitrary strings anywhere in the program, as these contribute to the output and test cases will fail. Input Format The first line of input contains an integer N, a number of elements. The second line of input contains N elements, each separated by a space. Output Format The output should display the numbers after applying Shubha's sorting algorithm, each separated by a single white space. Examples Example 1: Input: 7 51 13 107 27 47 59 99 Output: 107 13 27 4