Friday, September 22, 2023

Write a program that will read a list of student marks in the range 0 ... 100 and tell how many students scored in each range of 10 - how many scored 0 - 9, how many 10 -19, 20 - 29 ... and so on.

Input Format

------------------- 

The first line of input consists of one positive integer which intimates the number of elements in the array.

Followed by the elements of the integer array.

Refer to the sample input for formatting specifications.

Output Format

---------------- 

The output consists of the number of elements present in the predefined ranges.

Refer to the sample output for formatting specifications.


Sample Input  

7

23 45 76 103 87 -12 84


Sample Output 

0-9: 0

10-19: 0

20-29: 1

30-39: 0

40-49: 1

50-59: 0

60-69: 0

70-79: 1

80-89: 2

90-100: 0

Invalid: 2





Sample Input  

21

12 41 62 63 104 3 -9 72 55 73 98 107 -10 112 4 31 11 113 51 64 94


Sample Output 

0-9: 2

10-19: 2

20-29: 0

30-39: 1

40-49: 1

50-59: 2

60-69: 3

70-79: 2

80-89: 0

90-100: 2

Invalid: 6



Given two strings, S and T, of equal length, pick some characters from the first string and some from the second string, and then form a new string by rearranging the characters picked. Find the length of the longest string that you can make, which will be a palindrome.


Example

Sample Input:

aba

bab

Sample Output:

5

Explanation:

One of the possible ways to form a palindrome of length 5 is by picking "aba" from the first string and "bab" from the second string, which gives "ababa".

Input Format

The first line contains a string S as input

The next line contains a string T as input.

Output Format

The output prints an integer, which denotes the maximum length of the palindrome that can be obtained.

Refer to the sample input and output for format specifications

Constraints

1<=|S| , |T|<=1000

Sample Input Sample Output

aba
bab
Sample Output 

5

 https://meet.google.com/tcg-zgzv-dye