class Solution:
def backspaceCompare(self, s: str, t: str) -> bool:
def check(string):
lst = []
for s in string:
if s != "#":
lst.append(s)
else:
if lst:
lst.pop()
return lst
return check(s) == check(t)
'CS > 알고리즘' 카테고리의 다른 글
[Leetcode] 649. Dota2 Senate (0) | 2023.05.05 |
---|---|
[Leetcode] 986. Interval List Intersections (0) | 2023.05.05 |
[Leetcode] 82. Remove Duplicates from Sorted List II (0) | 2023.05.04 |
[Leetcode] 2215. Find the Difference of Two Arrays (0) | 2023.05.03 |
[Leetcode] 1491. Average Salary Excluding the Minimum and Maximum Salary (0) | 2023.05.02 |