Skip to content

Commit f31510c

Browse files
authored
Create 2390-removing-stars-from-a-string.js
1 parent fd5d1d7 commit f31510c

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

2390-removing-stars-from-a-string.js

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/**
2+
* @param {string} s
3+
* @return {string}
4+
*/
5+
var removeStars = function(s) {
6+
const stk = []
7+
for(const e of s) {
8+
if(e !== '*') stk.push(e)
9+
else {
10+
stk.pop()
11+
}
12+
}
13+
return stk.join('')
14+
};

0 commit comments

Comments
 (0)