mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-04 15:01:40 +08:00
存量题库数据更新
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
<p>You are given a sentence <code>s</code> and an integer <code>k</code>. You want to <strong>truncate</strong> <code>s</code> such that it contains only the <strong>first</strong> <code>k</code> words. Return <code>s</code><em> after <strong>truncating</strong> it.</em></p>
|
||||
|
||||
<p> </p>
|
||||
<p><strong>Example 1:</strong></p>
|
||||
<p><strong class="example">Example 1:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong>Input:</strong> s = "Hello how are you Contestant", k = 4
|
||||
@@ -18,7 +18,7 @@ The first 4 words are ["Hello", "how", "are", &quo
|
||||
Hence, you should return "Hello how are you".
|
||||
</pre>
|
||||
|
||||
<p><strong>Example 2:</strong></p>
|
||||
<p><strong class="example">Example 2:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong>Input:</strong> s = "What is the solution to this problem", k = 4
|
||||
@@ -28,7 +28,7 @@ The words in s are ["What", "is" "the", "solu
|
||||
The first 4 words are ["What", "is", "the", "solution"].
|
||||
Hence, you should return "What is the solution".</pre>
|
||||
|
||||
<p><strong>Example 3:</strong></p>
|
||||
<p><strong class="example">Example 3:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong>Input:</strong> s = "chopper is not a tanuki", k = 5
|
||||
|
Reference in New Issue
Block a user