Medium
Partition Labels
Medium
55 submissions
25 coins
+100 XP
Greedy
Hash Table
Two Pointers
Problem Description
Split `s` into as many parts as possible so that each letter appears in at most one part. Return the sizes of the parts, in order.
**Example 1:**
```
Input: s = "ababcbacadefegdehijhklij"
Output: [9, 7, 8]
```
**Example 2:**
```
Input: s = "eccbbbbdec"
Output: [10]
```
**Example 3:**
```
Input: s = "abc"
Output: [1, 1, 1]
```
Constraints
- `1 <= s.length <= 500`
- Lowercase English letters only.
Need help?
Connect with expert programmers for real-time collaborative coding, video meetings, and whiteboard sessions via CodeConnect.
Video Call
Whiteboard
Live Coding
Screen Share