We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 661eb3c commit 02279f5Copy full SHA for 02279f5
2490-circular-sentence.js
@@ -0,0 +1,16 @@
1
+/**
2
+ * @param {string} sentence
3
+ * @return {boolean}
4
+ */
5
+var isCircularSentence = function(sentence) {
6
+ const arr = sentence.split(' ')
7
+ const n = arr.length
8
+ for(let i = 0; i < n; i++) {
9
+ if(i === n - 1) {
10
+ if(arr[i][arr[i].length - 1] !== arr[0][0]) return false
11
+ } else {
12
+ if(arr[i][arr[i].length - 1] !== arr[i + 1][0]) return false
13
+ }
14
15
+ return true
16
+};
0 commit comments