Skip to content

Commit 4bcc81a

Browse files
committed
Jan 13
1 parent cb46698 commit 4bcc81a

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
from collections import Counter
2+
3+
4+
class Solution:
5+
def minimumLength(self, s: str) -> int:
6+
return sum(1 if c & 1 else 2 for c in Counter(s).values())
7+
8+
9+
def main():
10+
s = 'abaacbcbb'
11+
assert Solution().minimumLength(s) == 5
12+
13+
s = 'aa'
14+
assert Solution().minimumLength(s) == 2
15+
16+
17+
if __name__ == '__main__':
18+
main()

2025-01-January-LeetCoding-Challenge/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
| January 10 | [916. Word Subsets](https://leetcode.com/problems/word-subsets/) | Medium | Solved |
1616
| January 11 | [1400. Construct K Palindrome Strings](https://leetcode.com/problems/construct-k-palindrome-strings/) | Medium | Solved |
1717
| January 12 | []() | | |
18-
| January 13 | []() | | |
18+
| January 13 | [3223. Minimum Length of String After Operations](https://leetcode.com/problems/minimum-length-of-string-after-operations/) | Medium | Solved |
1919
| January 14 | []() | | |
2020
| January 15 | []() | | |
2121
| January 16 | []() | | |
@@ -40,5 +40,5 @@
4040
| Level | Problems | Solved | Unsolved |
4141
| --- | --- | --- | --- |
4242
| Easy | 4 | 4 | 0 |
43-
| Medium | 7 | 7 | 0 |
43+
| Medium | 8 | 8 | 0 |
4444
| Hard | 0 | 0 | 0 |

0 commit comments

Comments
 (0)