20. Valid Parentheses1 LeetCode - 20. Valid Parentheses - swift https://leetcode.com/problems/valid-parentheses/ Valid Parentheses - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 기본적인 자료구조인 Stack을 이용하는 문제이다. 주어진 s문자열을 하나씩 탐색하는데, ( , { , [ 인경우에는 무조건 stack메모리에 추가해준다. 그외의경우에는 추가하지않는데, 이때, stack메모리의 마지막원소와 같은 bracket인지를 판별해야한다. 맞다면 마지막원소를 삭제하고, 그.. 2021. 6. 16. 이전 1 다음