Company: AQR Capital
Difficulty: easy
Digit Pattern Types You are given an array of N non-negative integers. Classify every integer of the array into exactly one of six types, based only on the decimal digits of that integer. Write the integer without leading zeros (the value 0 is written as the single digit 0 ) and look at its digit sequence. A digit is called repeated if that same digit value occurs at least twice in the number. Let R be the number of distinct digit values that are repeated. For example, in 12344 the only repeated digit value is 4 , so R = 1 ; in 1223344 the repeated digit values are 2 , 3 and 4 , so R = 3 ; in 6666 the only repeated digit value is 6 , so R = 1 . The digit sequence is ascending if every digit is greater than or equal to the digit before it, and the number contains at least two different digit values. It is descending if every digit is less than or equal to the digit before it, and the number contains at least two different digit values. A number whose digits are all the same value ( 7 ,