CLEVERTAP Hiring | Check if Number Has Equal Digit Count and Digit Value | Off-Campus OA (2022)

Question · Posted Jun 2026

Problem Statement You are given a 0-indexed string num consisting only of digits. For every index i in the string: The digit at position i (num[i]) represents how many times digit i should appear in the entire string. Return: true if the condition holds for every index. false otherwise. In other words, for each index i: count of digit i in num == numeric value of num[i] Example 1 Input num = "1210" Output true Explanation Frequency of digits: Digit ...

The full answer & interview discussion are available to premium members.

Log in Create a free account