// Package q2390 implements a solution for https://leetcode.com/problems/removing-stars-from-a-string/ 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