Tap here to switch tabs
Problem
Submissions

Problem: Check if Number Has Equal Digit Count and Digit Value

med
30 min
Try to solve the Check if Number Has Equal Digit Count and Digit Value problem.

Statement

Given a 00-indexed string num of length n consisting of digits, determine if for every index i from 00 to n - 1, the digit i appears exactly num[i] times in num.

Return true if this condition holds for all indices, or false otherwise.

Constraints:

  • n == num.length

  • 1≤1 \leq n ≤10\leq 10

  • num consists of digits.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Check if Number Has Equal Digit Count and Digit Value

med
30 min
Try to solve the Check if Number Has Equal Digit Count and Digit Value problem.

Statement

Given a 00-indexed string num of length n consisting of digits, determine if for every index i from 00 to n - 1, the digit i appears exactly num[i] times in num.

Return true if this condition holds for all indices, or false otherwise.

Constraints:

  • n == num.length

  • 1≤1 \leq n ≤10\leq 10

  • num consists of digits.