Skip to content

Commit c68b096

Browse files
authored
Create 2124-check-if-all-as-appears-before-all-bs.js
1 parent 28d4e7c commit c68b096

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)