Skip to content

Commit 5d3470a

Browse files
committed
Runtime: 1 ms (Top 96.8%) | Memory: 41.04 MB (Top 50.9%)
1 parent 05f538c commit 5d3470a

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Runtime: 1 ms (Top 96.8%) | Memory: 41.04 MB (Top 50.9%)
2+
3+
class Solution {
4+
public boolean isCircularSentence(String s) {
5+
for(int i=0;i<s.length();i++)
6+
{
7+
if(s.charAt(i)==' ')
8+
{
9+
if(s.charAt(i-1)!=s.charAt(i+1))
10+
{
11+
return false;
12+
}
13+
}
14+
}
15+
return s.charAt(0) == s.charAt(s.length()-1);
16+
}
17+
}

0 commit comments

Comments
 (0)