first and second of the same length. Pick a cut position and cut both strings at that same spot, so each splits into a head and a tail (either part may be empty).
Then glue the head of one string to the tail of the other: the head of first with the tail of second, or the head of second with the tail of first.
Return True if for at least one cut position one of the two glued strings is a palindrome, and False otherwise.first='kayxq', second='plbak' → True
Cut after the third letter: kay + ak = kayak, which is a palindrome.
first='abc', second='dbe' → False
No cut point turns either the head of first plus the tail of second, or the other way round, into a palindrome.
first='q', second='w' → True
first='kayxq', second='plbak'
True
Run checks the first 3 tests in your browser. Submit checks all 89 tests on the server, hidden ones included.