Skip to content

Instantly share code, notes, and snippets.

@fida10
Created August 5, 2022 04:12
Show Gist options
  • Save fida10/8e31f23874ccbb13869bc7bc25120666 to your computer and use it in GitHub Desktop.
Save fida10/8e31f23874ccbb13869bc7bc25120666 to your computer and use it in GitHub Desktop.
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