#3760

Maximum Substrings With Distinct Start

medium · 91.4% accepted · 69 likes · top 100%

hash table · string

Description

You are given a string s consisting of lowercase English letters.

Return an integer denoting the maximum number of substrings you can split s into such that each substring starts with a distinct character (i.e., no two substrings start with the same character).

Solution