Number of digits in the nth number made of given four digits
Given an integer n, find the number of digits in the n-th number formed using only the digits 1, 4, 6, and 9, when the numbers are arranged in ascending order. 1, 4, 6, 9, 11, 14, 16, 19, 41, 44, 46, 49, 61, 64, 66, 69, 91, 94, 96, 99, 111, 114, 116, 119, .... Examples: Input: n = 6Output: 2Explanat