2283. Check if Number Has Equal Digit Count and Digit Value

Обновлено: 2024-03-12
1 мин
[]

Содержание

LeetCode problem 2283

class Solution:
    def digitCount(self, num: str) -> bool:
        cnt = Counter(num)
        return all(cnt[str(i)] == int(v) for i, v in enumerate(num))