Hireview, two questions.
For the first question, I was given 30 minutes, and for the second, 40 minutes.
1st question.
A number is self describing if the digit in each position is equal to the number of times the digit appears in the number. For each input N, print 1 if the number is self describing. Otherwise, print 0.
For example, N = 2020 is self describing because the number in the 0th index is 2, and there are two 0's in N. The number in the 1st index is 0, and there are zero 1's in N. The number in the 2nd index is 2, and there are two 2's in N. The number in the 3rd index is 0, there are zero 3's in N.
2nd question.
You are given a string containing jumbled letters from several concatenated words. Each word is a numeral from 'zero' to 'nine'. Each numeral may be used multiple times. Output the numerals within the jumbled string in ascending order.
For example, 'reuonnoinfe' are shuffled letters of the strings 'one', 'four', 'nine'. Your program's output should be 149.