Human Readable Explanations - No code
The goal is to make a b the same, so we can just apend ababab... to the end of result.\n\n\n(1) if a > b: res += "aab"\n(2) else if b > a: res += "bba"\n(3) els
The goal is to make a b the same, so we can just apend ababab... to the end of result.\n\n```\n(1) if a > b: res += "aab"\n(2) else if b > a: res += "bba"\n(3) else : res += "ab" * a\n```\n\nYou might have doubts: what if we have (1) then immediately (2), so we get ```aabbba``` wrong results? \n***No, it is not possbile. After appending "aab", a will be still greater or at least equal to b.***\n\n
[]