parameters: (self, N)
return_statement: return result
docstring: :type N: int
          :rtype: int
docstring_summary: :type N: int
          :rtype: int
docstring_tokens: : type N : int : rtype : int
function: def rotatedDigits(self, N):
          """
          :type N: int
          :rtype: int
          """
          invalid, diff = set(['3', '4', '7']), set(['2', '5', '6', '9'])
          result = 0
          for i in xrange(N+1):
              lookup = set(list(str(i)))
              if invalid & lookup:
                  continue
              if diff & lookup:
                  result += 1
          return result
function_tokens: def rotatedDigits ( self , N ) : invalid , diff = set ( [ '3' , '4' , '7' ] ) , set ( [ '2' , '5' , '6' , '9' ] ) result = 0 for i in xrange ( N + 1 ) : lookup = set ( list ( str ( i ) ) ) if invalid & lookup : continue if diff & lookup : result += 1 return result