Solving “Greatest Common Divisor of Strings Leetcode-1071” in JS: From Naive to Optimal

Think like this: you’re in a coding interview. The interviewer drops a “simple string problem” on you. You smile. Strings? Easy.