Skip to content

Commit 3c22d2a

Browse files
committed
Create README - LeetHub
1 parent c8a50d3 commit 3c22d2a

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

2490-circular-sentence/README.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
<h2><a href="https://leetcode.com/problems/circular-sentence/">2490. Circular Sentence</a></h2><h3>Easy</h3><hr><div><p>A <strong>sentence</strong> is a list of words that are separated by a<strong> single</strong> space with no leading or trailing spaces.</p>
2+
3+
<ul>
4+
<li>For example, <code>"Hello World"</code>, <code>"HELLO"</code>, <code>"hello world hello world"</code> are all sentences.</li>
5+
</ul>
6+
7+
<p>Words consist of <strong>only</strong> uppercase and lowercase English letters. Uppercase and lowercase English letters are considered different.</p>
8+
9+
<p>A sentence is <strong>circular </strong>if:</p>
10+
11+
<ul>
12+
<li>The last character of a word is equal to the first character of the next word.</li>
13+
<li>The last character of the last word is equal to the first character of the first word.</li>
14+
</ul>
15+
16+
<p>For example, <code>"leetcode exercises sound delightful"</code>, <code>"eetcode"</code>, <code>"leetcode eats soul" </code>are all circular sentences. However, <code>"Leetcode is cool"</code>, <code>"happy Leetcode"</code>, <code>"Leetcode"</code> and <code>"I like Leetcode"</code> are <strong>not</strong> circular sentences.</p>
17+
18+
<p>Given a string <code>sentence</code>, return <code>true</code><em> if it is circular</em>. Otherwise, return <code>false</code>.</p>
19+
20+
<p>&nbsp;</p>
21+
<p><strong class="example">Example 1:</strong></p>
22+
23+
<pre><strong>Input:</strong> sentence = "leetcode exercises sound delightful"
24+
<strong>Output:</strong> true
25+
<strong>Explanation:</strong> The words in sentence are ["leetcode", "exercises", "sound", "delightful"].
26+
- leetcod<u>e</u>'s&nbsp;last character is equal to <u>e</u>xercises's first character.
27+
- exercise<u>s</u>'s&nbsp;last character is equal to <u>s</u>ound's first character.
28+
- soun<u>d</u>'s&nbsp;last character is equal to <u>d</u>elightful's first character.
29+
- delightfu<u>l</u>'s&nbsp;last character is equal to <u>l</u>eetcode's first character.
30+
The sentence is circular.</pre>
31+
32+
<p><strong class="example">Example 2:</strong></p>
33+
34+
<pre><strong>Input:</strong> sentence = "eetcode"
35+
<strong>Output:</strong> true
36+
<strong>Explanation:</strong> The words in sentence are ["eetcode"].
37+
- eetcod<u>e</u>'s&nbsp;last character is equal to <u>e</u>etcode's first character.
38+
The sentence is circular.</pre>
39+
40+
<p><strong class="example">Example 3:</strong></p>
41+
42+
<pre><strong>Input:</strong> sentence = "Leetcode is cool"
43+
<strong>Output:</strong> false
44+
<strong>Explanation:</strong> The words in sentence are ["Leetcode", "is", "cool"].
45+
- Leetcod<u>e</u>'s&nbsp;last character is <strong>not</strong> equal to <u>i</u>s's first character.
46+
The sentence is <strong>not</strong> circular.</pre>
47+
48+
<p>&nbsp;</p>
49+
<p><strong>Constraints:</strong></p>
50+
51+
<ul>
52+
<li><code>1 &lt;= sentence.length &lt;= 500</code></li>
53+
<li><code>sentence</code> consist of only lowercase and uppercase English letters and spaces.</li>
54+
<li>The words in <code>sentence</code> are separated by a single space.</li>
55+
<li>There are no leading or trailing spaces.</li>
56+
</ul>
57+
</div>

0 commit comments

Comments
 (0)