recca chao 的 gitHub page

寫一些技術文件,筆記,雜七雜八

View on GitHub

Problem 27

Description

This problem was asked by Facebook.

Given a string of round, curly, and square open and closing brackets, return whether the brackets are balanced (well-formed).

For example, given the string ([])[]({}), you should return true.

Given the string ([)] or (((), you should return false.

Solutions

參考 leet code

https://leetcode.com/problems/valid-parentheses/

假設題目如下

class Solution {
    fun isValid(s: String): Boolean {
    }
}

參考解法