Skip to content

Commit 5ae9b78

Browse files
authored
Create 2490_circular_sentence.cpp
1 parent 3ef682d commit 5ae9b78

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

solutions/2490_circular_sentence.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
class Solution {
2+
public:
3+
bool isCircularSentence(string s) {
4+
for(int i=0;i<s.size();i++){
5+
if(s[i]==' ' && s[i-1]!=s[i+1]){
6+
return false;
7+
}
8+
}
9+
return s[0] == s[s.size()-1];
10+
}
11+
};

0 commit comments

Comments
 (0)