[LeetCode] Find Special Substring of Length K

1 · · Feb. 16, 2025, 12:09 p.m.
Summary
3456. Find Special Substring of Length K You are given a string s and an integer k. Determine if there exists a substring of length exactly k in s that satisfies the following conditions: The substring consists of only one distinct character (e.g., "aaa" or "bbb"). If there is a character immediately before the substring, it must be different from the character in the substring. If there is a character immediately after the substring, it must also be different from the character in the substri...