KAAR First-Round Coding Question
Remove Zeros and Rearrange Digits
Problem
1. Given a number, remove all zeros and rearrange the digits so that the sum of digits remains the
same pattern as in the original number.
Example
Input
503007
Output
513117
2. Reverse a Number
Input
12345
Output
54321
Simple logic using modulus (%) and division (/).
3. Palindrome Check
Check whether a number or string is a palindrome.
Example
Input
121
Output
Palindrome
4. Largest Element in Array
Input
10 45 22 78 6
Output
78
5. Count Vowels in String
Input
"Kaar Technologies"
Output
7
6. Fibonacci Series
Input
6
Output
011235
7. Prime Number Check
Input
7
Output
Prime
8. Sum of Digits
Input
1234
Output
10