Soal
00:00

2. Valid Parentheses

MudahStackAmazonMicrosoft

Given a string s containing only bracket characters, determine whether the brackets are valid.

Contoh 1:

Input: s = "()"
Output: true

Contoh 2:

Input: s = "([)]"
Output: false

Batasan:

  • 1 <= s.length <= 10^4
Mode kode inti
● Tersimpan otomatisBaris 1, kolom 1