LeetCodeRemove All Adjacent Duplicates In StringRemove All Adjacent Duplicates In StringEasyStringStackSolution export function removeDuplicates(s: string): string { const stack: string[] = []; const topOfStack = () => stack[stack.length - 1]; for (const char of s) { if (topOfStack() === char) { stack.pop(); } else { stack.push(char); } } return stack.join(''); }LeetCodeRemove All Adjacent Duplicates In Stringhttps://leetcode.com/problems/remove-all-adjacent-duplicates-in-string