We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 28d4e7c commit c68b096Copy full SHA for c68b096
2124-check-if-all-as-appears-before-all-bs.js
@@ -0,0 +1,9 @@
1
+/**
2
+ * @param {string} s
3
+ * @return {boolean}
4
+ */
5
+const checkString = function(s) {
6
+ const la = s.lastIndexOf('a')
7
+ const fb = s.indexOf('b')
8
+ return fb === -1 ? true : la < fb
9
+};
0 commit comments