Tap here to switch tabs
Problem
Submissions

Problem: Smallest Index With Digit Sum Equal to Index

med
30 min
Try to solve the Smallest Index With Digit Sum Equal to Index problem.

Statement

You are given an integer array nums.

Find the smallest index i such that the sum of the digits of nums[i] is equal to i.

Return the smallest such index i. If no such index exists, return −1-1.

Constraints:

  • 1≤1 \leq nums.length ≤100\leq 100

  • 0≤0 \leq nums[i] ≤1000\leq 1000

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Smallest Index With Digit Sum Equal to Index

med
30 min
Try to solve the Smallest Index With Digit Sum Equal to Index problem.

Statement

You are given an integer array nums.

Find the smallest index i such that the sum of the digits of nums[i] is equal to i.

Return the smallest such index i. If no such index exists, return −1-1.

Constraints:

  • 1≤1 \leq nums.length ≤100\leq 100

  • 0≤0 \leq nums[i] ≤1000\leq 1000