We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 875327c commit dc0599eCopy full SHA for dc0599e
scripts/algorithms/R/Rotate String/Rotate String.js
@@ -1,8 +1,9 @@
1
+// Runtime: 96 ms (Top 39.69%) | Memory: 41.8 MB (Top 87.19%)
2
var rotateString = function(s, goal) {
- const n = s.length;
3
+ const n = s.length;
4
for(let i = 0; i < n; i++) {
5
s = s.substring(1) + s[0];
- if(s === goal) return true;
6
+ if(s === goal) return true;
7
}
- return false;
8
-};
+ return false;
9
+};
0 commit comments