Algorithm · Expedia · Hard
Problem You are given an array strings. For each string s in this array, count how many of its non-empty substrings can be rearranged into a palindrome by swapping characters, where any number of swaps is allowed. A substring can be rearranged into a palindrome if its letters can be permuted in some way so that the resulting string reads the same forwards and backwards. Palindrome-permutation condition A string can be permuted into a palindrome exactly when the number of…
Checking your access…