4
This commit is contained in:
6
solutions/lc3931.py
Normal file
6
solutions/lc3931.py
Normal 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
|
||||
Reference in New Issue
Block a user