161ms lazy python solution

  • -6

    I don't know whether it's valid using exception. But if it's available, then nothing is easier than that.

    class Solution:
        # @param s, a string
        # @return a boolean
        def isNumber(self, s):
                x = float(s)
                return False
            return True

Log in to reply

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.