Tap here to switch tabs
Problem
Submissions

Problem: Numbers With Same Consecutive Differences

Try to solve the Numbers With Same Consecutive Differences problem.

Statement

Given two integers n and k, return an array of all integers of length n such that the absolute difference between every two consecutive digits is equal to k.

You may return the answer in any order.

Note: Every integer in the answer must have exactly n digits and cannot contain leading zeros.

Constraints:

  • 2≤2 \leq n ≤9\leq 9

  • 0≤0 \leq k ≤9\leq 9

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Numbers With Same Consecutive Differences

Try to solve the Numbers With Same Consecutive Differences problem.

Statement

Given two integers n and k, return an array of all integers of length n such that the absolute difference between every two consecutive digits is equal to k.

You may return the answer in any order.

Note: Every integer in the answer must have exactly n digits and cannot contain leading zeros.

Constraints:

  • 2≤2 \leq n ≤9\leq 9

  • 0≤0 \leq k ≤9\leq 9