Leetcode 1071. Greatest Common Divisor of Strings

In this challenge, we are presented with the following prompt: