Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- type stack []rune
- func (s *stack) push(b rune) {
- *s = append(*s, b)
- }
- func (s *stack) pop() (rune, bool) {
- if len(*s) > 0 {
- res := (*s)[len(*s)-1]
- *s = (*s)[:len(*s)-1]
- return res, true
- }
- return 0, false
- }
Add Comment
Please, Sign In to add comment