Tap here to switch tabs
Problem
Submissions

Problem: Check Adjacent Digit Differences

med
30 min
Try to solve the Check Adjacent Digit Differences problem.

Statement

You are given a string s consisting solely of numerical digits.

Return true if the absolute difference between every pair of adjacent digits in s is at most 22, and false otherwise.

Constraints:

  • 2≤2 \leq s.length ≤100\leq 100

  • s consists only of digits.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Check Adjacent Digit Differences

med
30 min
Try to solve the Check Adjacent Digit Differences problem.

Statement

You are given a string s consisting solely of numerical digits.

Return true if the absolute difference between every pair of adjacent digits in s is at most 22, and false otherwise.

Constraints:

  • 2≤2 \leq s.length ≤100\leq 100

  • s consists only of digits.