Skip to content

add algorithm to check if given string is valid number or not #11479

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
resolve ruff check failing
  • Loading branch information
reniz-shah committed Aug 8, 2024
commit 272b0caf6a8beb32bb82ef1ed4957d476559e3d5
3 changes: 1 addition & 2 deletions strings/string_is_valid_number.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"""

from enum import Enum
from typing import Dict


class CharType(Enum):
Expand All @@ -27,7 +26,7 @@
EXP_NUMBER = "EXP_NUMBER"


state_machine: Dict[State, Dict[CharType, State]] = {
state_machine: dict[State, dict[CharType, State]] = {
State.INITIAL: {
CharType.NUMERIC: State.WHOLE,
CharType.SIGN: State.SIGNED,
Expand All @@ -52,7 +51,7 @@
State.EXP_NUMBER: {CharType.NUMERIC: State.EXP_NUMBER},
}

from enum import Enum

Check failure on line 54 in strings/string_is_valid_number.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (E402)

strings/string_is_valid_number.py:54:1: E402 Module level import not at top of file


class CharType(Enum):
Expand Down
Loading