add new solutions
This commit is contained in:
parent
ca24d0a56a
commit
0c73608ce5
36 changed files with 791 additions and 0 deletions
18
solutions/23/q2390/solution.go
Normal file
18
solutions/23/q2390/solution.go
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
package q2390
|
||||
|
||||
func removeStars(s string) string {
|
||||
edit := []byte(s)
|
||||
p := 0
|
||||
|
||||
for _, c := range edit {
|
||||
if c == '*' {
|
||||
p--
|
||||
} else {
|
||||
edit[p] = c
|
||||
p++
|
||||
}
|
||||
}
|
||||
return string(edit[:p])
|
||||
}
|
||||
|
||||
var _ = removeStars
|
||||
Loading…
Add table
Add a link
Reference in a new issue