3550. Smallest Index With Digit Sum Equal to Index
You are given an integer array nums. Return the smallest index i such that the sum of the digits of nums[i] is equal to i. If no such index exists, return -1. Example 1: Input: nums = [1,3,2] Output: 2 Explanation: - For nums[2] = 2, the sum of digits is 2, which is equal to index i = 2. Thus, the output is 2. Example 2: Input: nums = [1,10,11] Output: 1 Explanation: - For nums[1] =
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start