-
[LeetCode] Backspace String Compare알고리즘 2022. 5. 4. 23:10
844.Backspace String Compare
class Solution: def backspaceCompare(self, s: str, t: str) -> bool: def Makestring(myString): ss = "" for char in myString: if (char != "#"): ss += char else: if (len(ss) == 0): continue ss = ss[0:-1] return ss return Makestring(s) == Makestring(t)
'알고리즘' 카테고리의 다른 글
A star 알고리즘 (python) 설명 (0) 2022.05.06 [LeetCode] Shortest Path in Binary Matrix 풀이 (Python) (0) 2022.05.06 [LeetCode] Remove Duplicates from Sorted List II (0) 2022.05.04 [LeetCode] Search in Rotated Sorted Array (0) 2022.05.04 [LeetCode] Single Number (0) 2022.05.03