Practice Palindrome Rearrangement Queries
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Problem Statement
Given an even-length string s and queries [a, b, c, d], consider each query independently on the original string. You may rearrange the characters in s[a..b] within the first half and independently rearrange s[c..d] within the second half. Both ranges include their endpoints; characters outside them stay unchanged. Return one boolean per query indicating whether these rearrangements can make the whole string a palindrome.
Source: Palindrome Rearrangement Queries on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
s = "abcabc", queries = [[1,1,3,5],[0,2,5,5]]
[true,true]
# Example 2
s = "abbcdecbba", queries = [[0,2,7,9]]
[false]
# Example 3
s = "acbcab", queries = [[1,2,4,5]]
[true]
Constraints
Related LeetCode Problems
Practice more problems similar to Palindrome Rearrangement Queries.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.