This commit is contained in:
Vombit
2026-05-26 15:38:10 +05:00
parent 352ed5d27c
commit df1dbfd0ae
5 changed files with 116 additions and 29 deletions

6
solutions/lc3931.py Normal file
View File

@@ -0,0 +1,6 @@
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