Company: Google_5july
Difficulty: medium
Palindrome special Problem Description A number X is said to be palindrome special, if it satisfies the given conditions: Every digit r present in X, occurs r number of times in X. Digits of X forms a palindrome i.e. it reads the same from right to left and left to right. You are given an integer N. Task: Determine the smallest palindrome special number greater than N. Function Description Complete the solve function provided in the editor. This function takes the following parameters and returns the required answer: N : Represents the value of N Input Format Note: This is the input format that you must use to provide custom input (available above the Compile and Test button). The first line contains a single integer T , which denotes the number of test cases. T also specifies the number of times you have to run the solve function on a different set of inputs. For each test case: The first line contains an integer N . Output Format For each test case in a new line, print the smallest p