Company: Intuit_7aug
Difficulty: medium
Crack Password Problem Description You work for a security company and are testing a password-cracking algorithm. You are given a string S of digits. Each password must be a maximum length palindrome, such that it is a substring of the given string and the digits in the palindromic password are in non-decreasing order (a palindrome is a word, phrase, or sequence that reads the same backward as forward, e.g., madam or nun). You need to determine how many passwords meet these requirements and find all of them. Input The first line of input contains n , representing the length of the input string. The second line of input contains the string S . Output The output should be a single line containing space-separated elements: the first element represents the number of possible passwords, k the next element(s) are the possible passwords in ascending order Examples Example 1: Input: 8 12234566 Output: 2 22 66 Explanation: There are two possible passwords - 22 and 66, which both satisfy the giv