JERRYLSU

Brackets Matching
by Jerry Su, post on Dec 16, 2022

brackets = {')': '(', '》': '《', ')': '('}
brackets_open, brackets_close = brackets.values(), brackets.keys()


def brackets_match(text: str) -> int:
    """Brackets Match
    """
    stack, error = [], []
    for idx, char in enumerate(text):
        if char in brackets_open:
            stack.append((idx, char))
        elif char in brackets_close:
            if stack and stack[-1][-1] == brackets[char]:
                stack.pop()
            else:
                error.append(idx)
    if stack …

Read in 1 mins
Sliding Window
by Jerry Su, post on Feb 24, 2021

Reason is the light and the light of life.

Viterbi Algorithm
by Jerry Su, post on Feb 22, 2021

Reason is the light and the light of life.

Read in 3 mins
A* Heuristic Algorithm
by Jerry Su, post on May 20, 2020

Reason is the light and the light of life.

Read in 3 mins
Sort
by Jerry Su, post on May 19, 2020

Reason is the light and the light of life.

Read in 2 mins
LinkedList
by Jerry Su, post on May 09, 2020

Reason is the light and the light of life.

Algorithms
by Jerry Su, post on Apr 28, 2020

Reason is the light and the light of life.

Read in 4 mins
BackTracking
by Jerry Su, post on Apr 09, 2020

Reason is the light and the light of life.

Topological Sorting
by Jerry Su, post on Jun 18, 2019

Reason is the light and the light of life.

Breadth First Search
by Jerry Su, post on Jun 16, 2019

Reason is the light and the light of life.