LeetCode solutions

2825. Minimize String Length

My accepted Python solution to LeetCode problem 2825, Minimize String Length, running in 7ms.

  • Difficulty: Easy
  • Python
  • Runtime 7ms
  • Memory 17.2MB

Read the problem on LeetCode View on GitHub

Python

Accepted on LeetCode — runtime 7ms, memory 17.2MB, accepted 2025-12-31.

python
class Solution:
    def minimizedStringLength(self, s: str) -> int:
        return len(set(s))

Source