mirror of
https://github.com/mudabbir-ahmad/Leet-Code-prog.git
synced 2026-10-07 18:30:20 +00:00
sol
This commit is contained in:
1 parent
39be980ffe
commit
b29cd3775d
1 file changed
+4
@@ -6,3 +6,7 @@ public:
|
||||
: ""; // else return nothing
|
||||
}
|
||||
};
|
||||
|
||||
// if str1 = BoomBoom and str2 = Boom
|
||||
// Then str1 + str2 = BoomBoomBoom and str2 + str1 = BoomBoomBoom (they're the same) so we return the substring of str1 starting at 0 to the gcd of the size of str1 and str2
|
||||
// size of str1 = 8 and size of str2 = 4 so the gcd of 8 and 4 is 4 so we return the substring of str1 starting at 0 to 4 which is Boom
|
||||
Reference in new issue
Block a user