class Solution:
def longestNiceSubstring(self, s: str) -> str:
'''
思路:子串是连续的,通过将字母变为小写or大写,判断字母的左右两边是否一样即可
'''
if not s or len(s) == 1:
return ''
res = ''
for i in range(len(s)-1):
res += s[i]
if s[i].upper() != s[i+1] or s[i].lower() != s[i+1]:
res = ''
return res