Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 849b5d2

Browse files
committed
docs: add 763. Partition Labels
1 parent cb78d3d commit 849b5d2

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

‎src/medium/readme.md‎

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2256,6 +2256,39 @@ Put the code below in main.rs and run `cargo run`
22562256
println!("result: {:?}", result);
22572257
```
22582258

2259+
# 763. Partition Labels
2260+
2261+
## Description
2262+
2263+
A string `s` of lowercase English letters is given. We want to partition this string into as many parts as possible so that each letter appears in at most one part, and return a list of integers representing the size of these parts.
2264+
2265+
## Examples
2266+
2267+
```text
2268+
Example 1:
2269+
2270+
Input: s = "ababcbacadefegdehijhklij"
2271+
Output: [9,7,8]
2272+
Explanation:
2273+
The partition is "ababcbaca", "defegde", "hijhklij".
2274+
This is a partition so that each letter appears in at most one part.
2275+
A partition like "ababcbacadefegde", "hijhklij" is incorrect, because it splits s into less parts.
2276+
Example 2:
2277+
2278+
Input: s = "eccbbbbdec"
2279+
Output: [10]
2280+
```
2281+
2282+
## How to Run in main.rs
2283+
2284+
Put the code below in main.rs and run `cargo run`
2285+
2286+
```rust
2287+
let s = String::from("ababcbacadefegdehijhklij");
2288+
let result = leetcode::medium::partition_labels::partition_labels(s);
2289+
println!("result: {:?}", result);
2290+
```
2291+
22592292
# 846. Hand of Straights
22602293

22612294
## Description

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /