Created
August 5, 2022 04:12
-
-
Save fida10/8e31f23874ccbb13869bc7bc25120666 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Solution: | |
def digitCount(self, num: str) -> bool: | |
for i in range(0, len(num)): | |
currentNum = num[i]; | |
currentCount = 0; | |
expectedCounter = int(currentNum); | |
for j in num: | |
if (j == str(i)): | |
currentCount += 1; | |
if (currentCount != expectedCounter): | |
return False; | |
return True; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment