題目
原題頁面:https://leetcode.com/problems/valid-number/
題目型別:Math, String
難度評價:hard
類似題目:(E) String to Integer (atoi)
Validate if a given string is numeric.
Some examples:
"0"=>true
" 0.1 "=>true
"abc"=>false
"1 a"=>false
"2e10"=>trueNote: It is intended for the problem statement to be ambiguous. You should gather all requirements up front before implementing one.
分析
有窮自動機DFA。話說這題用NFA可以解嗎?NFA的使用侷限是什麼?
程式碼
1 | class Solution: |
