Skip to content

Commit

Permalink
Jan 13
Browse files Browse the repository at this point in the history
  • Loading branch information
siddydutta committed Jan 13, 2025
1 parent cb46698 commit 4bcc81a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from collections import Counter


class Solution:
def minimumLength(self, s: str) -> int:
return sum(1 if c & 1 else 2 for c in Counter(s).values())


def main():
s = 'abaacbcbb'
assert Solution().minimumLength(s) == 5

s = 'aa'
assert Solution().minimumLength(s) == 2


if __name__ == '__main__':
main()
4 changes: 2 additions & 2 deletions 2025-01-January-LeetCoding-Challenge/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
| January 10 | [916. Word Subsets](https://leetcode.com/problems/word-subsets/) | Medium | Solved |
| January 11 | [1400. Construct K Palindrome Strings](https://leetcode.com/problems/construct-k-palindrome-strings/) | Medium | Solved |
| January 12 | []() | | |
| January 13 | []() | | |
| January 13 | [3223. Minimum Length of String After Operations](https://leetcode.com/problems/minimum-length-of-string-after-operations/) | Medium | Solved |
| January 14 | []() | | |
| January 15 | []() | | |
| January 16 | []() | | |
Expand All @@ -40,5 +40,5 @@
| Level | Problems | Solved | Unsolved |
| --- | --- | --- | --- |
| Easy | 4 | 4 | 0 |
| Medium | 7 | 7 | 0 |
| Medium | 8 | 8 | 0 |
| Hard | 0 | 0 | 0 |

0 comments on commit 4bcc81a

Please sign in to comment.