5
6
print("\(lhs.prefix(lhs.count - lhs.enumerated().map{lhs.suffix(lhs.count-$0.offset)}.first{rhs.hasPrefix($0)}!.count))\(rhs)")
WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
Welcome to SwiftFiddle.
Empower our project through your generous support on GitHub Sponsors! 💖
https://github.com/sponsors/kishikawakatsumi/