We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 05f538c commit 5d3470aCopy full SHA for 5d3470a
scripts/algorithms/C/Circular Sentence/Circular Sentence.java
@@ -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