Question 1: Given a string, determine the number of distinct palindromic substrings of a specified length.
- A string.
- An integer representing the length of the substrings.
- The number of distinct palindromic substrings.
string = "ababa"
length = 3
Question 2: Determine if a string can be rearranged such that all characters have the same frequency. If one removal can achieve this, return "valid", otherwise return "invalid".
- A string.
- "valid" if the string meets the criteria, otherwise "invalid".
string = "aabbcc"