Stack
LeetCode / Stack / 394번 / Decode String / JS
Decode String - LeetCode Can you solve this real interview question? Decode String - Given an encoded string, return its decoded string. The encoding rule is: k[encoded_string], where the encoded_string inside the square brackets is being repeated exactly k times. Note that k is g leetcode.com [] 괄호 쌍 안에 있는 문자열을 바로 앞에 온 숫자만큼 반복한다. 예를 들어 "3[a]2[bc]" 일 경우엔, "aaabcbc" 가 된다. ..
LeetCode / Stack / 844번 / Backspace String Compare / JS
Backspace String Compare - LeetCode Can you solve this real interview question? Backspace String Compare - Given two strings s and t, return true if they are equal when both are typed into empty text editors. '#' means a backspace character. Note that after backspacing an empty text, the tex leetcode.com 문자열 s와 t가 주어진다. 문자열에 #이 있다면 이전에 입력한 문자는 지워진다. 예를들면, "ab#c" 일 경우엔 a를 ..