You are given a string s and an integer k.
Determine if there exists a substring of s of length
The substring consists of exactly
If a character immediately precedes the substring, it must be different from the character inside the substring.
If a character immediately succeeds the substring, it must be different from the character inside the substring.
Return true if such a substring exists, or false otherwise.
Constraints:
s.length
s consists of lowercase English letters only.
You are given a string s and an integer k.
Determine if there exists a substring of s of length
The substring consists of exactly
If a character immediately precedes the substring, it must be different from the character inside the substring.
If a character immediately succeeds the substring, it must be different from the character inside the substring.
Return true if such a substring exists, or false otherwise.
Constraints:
s.length
s consists of lowercase English letters only.