LeetCode solutions

4087. Maximum Substrings With Distinct Start

My accepted Python solution to LeetCode problem 4087, Maximum Substrings With Distinct Start, running in 8ms.

  • Difficulty: Medium
  • Python
  • Runtime 8ms
  • Memory 18.3MB

Read the problem on LeetCode View on GitHub

Python

Accepted on LeetCode — runtime 8ms, memory 18.3MB, accepted 2025-12-30.

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

Source