Skip to content

Commit d309226

Browse files
committed
Time: 1 ms (96.81%), Space: 41.9 MB (54.87%) - LeetHub
1 parent 3c22d2a commit d309226

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
class Solution {
2+
public boolean isCircularSentence(String s) {
3+
for(int i=0;i<s.length();i++)
4+
{
5+
if(s.charAt(i)==' ')
6+
{
7+
if(s.charAt(i-1)!=s.charAt(i+1))
8+
{
9+
return false;
10+
}
11+
}
12+
}
13+
return s.charAt(0) == s.charAt(s.length()-1);
14+
}
15+
}

0 commit comments

Comments
 (0)