Function to convert x into its digit vector and uses count ( ) function to return the required count
def solve ( x ) : NEW_LINE INDENT global dp NEW_LINE num = [ ] NEW_LINE while x : NEW_LINE INDENT num . append ( x % 10 ) NEW_LINE x //= 10 NEW_LINE DEDENT num . reverse ( ) NEW_LINE DEDENT