Check if Number Has Equal Digit Count and Digit Value Problem

Check if Number Has Equal Digit Count and Digit Value Problem — ExecCode Easy DSA Practice

Solve the Check if Number Has Equal Digit Count and Digit Value problem on ExecCode. Free online easy DSA practice in Hashing. Write and run code in Java, C++, Python — no signup required to run.

Problem description

Description You are given a 0-indexed string num of length n consisting of digits. Your task is to compute the required answer and return true if for every index i in the range 0 <= i < n , the digit i occurs num[i] times in num , otherwise return false.

Examples

Input {"num": "1210"}; Output True. Input {"num": "030"}; Output False

Constraints

n == num.length 1 <= n <= 10 num consists of digits.

Practice Check if Number Has Equal Digit Count and Digit Value free on ExecCode. Browse DSA problems, topic map, and placement guides.