Files
LeetCode_tasks/solutions/lc3931.py
Vombit df1dbfd0ae 4
2026-05-26 15:38:10 +05:00

7 lines
206 B
Python

class Solution:
def isAdjacentDiffAtMostTwo(self, s: str) -> bool:
for i in range(1, len(s)):
if abs(int(s[i]) - int(s[i - 1])) > 2:
return False
return True