Leetcode 1177. Can Make Palindrome from Substring
Given many queries on a string asking whether a substring can be rearranged and with up to k single-character replacements turned into a palindrome, the task is to quickly compute the substring's character parities (or odd counts) using prefix counts/bitmasks and check if the number of odd-frequency letters can be fixed with k replacements (equivalently floor(oddCount/2) <= k, with up to one odd allowed for odd-length substrings).
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
0
Hello Interview Premium
Your account is free and you can post anonymously if you choose.