Skip to content

Commit b973a1a

Browse files
committed
Do daily
1 parent 227ba7a commit b973a1a

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

my-submissions/e1399 oneliner.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
class Solution:
2+
def countLargestGroup(self, n: int) -> int:
3+
return (output := Counter(Counter([sum(map(int, str(x))) for x in range(1, n + 1)]).values()))[max(output.keys())]

my-submissions/e1399.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
class Solution:
2+
def countLargestGroup(self, n: int) -> int:
3+
gps = Counter([sum(map(int, str(x))) for x in range(1, n + 1)])
4+
output = Counter(gps.values())
5+
return output[max(output.keys())]

0 commit comments

Comments
 (0)