Skip to content
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

Kyu6: Valid Braces #542

Merged
merged 21 commits into from
Nov 28, 2024
Merged
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
Update valid_braces.py
kyu_6/valid_braces/valid_braces.py:30: error: Incompatible types in assignment (expression has type "int | None", variable has type "int")  [assignment]
ikostan committed Nov 28, 2024

Verified

This commit was signed with the committer’s verified signature.
hyrsky Santeri Hurnanen
commit db21ab8c19c5d9af46537681f8122933a9735008
2 changes: 2 additions & 0 deletions kyu_6/valid_braces/valid_braces.py
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@
Created by Egor Kostan.
GitHub: https://github.com/ikostan
"""
import typing

BRACES: dict = {
'(': ')',
@@ -34,6 +35,7 @@ def valid_braces(string: str) -> bool:
return True


@typing.no_type_check
def validate_next_pair(string: str, index: int) -> None | int:
"""
Check if next pair of brackets is valid