2283. Check if Number Has Equal Digit Count and Digit Value
Easy
You are given a 0-indexed string num
of length n
consisting of digits.
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
.
Example 1:
Example 2:
Constraints:
n == num.length
1 <= n <= 10
num
consists of digits.
解題
Runtime: 3 ms, faster than 35.71%
Memory Usage: 1.9 MB, less than 100.00%
Previous2279. Maximum Bags With Full Capacity of RocksNext2287. Rearrange Characters to Make Target String
Last updated