Guest User

Untitled

a guest
Jul 19th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. type stack []rune
  2.  
  3. func (s *stack) push(b rune) {
  4. *s = append(*s, b)
  5. }
  6.  
  7. func (s *stack) pop() (rune, bool) {
  8. if len(*s) > 0 {
  9. res := (*s)[len(*s)-1]
  10. *s = (*s)[:len(*s)-1]
  11. return res, true
  12. }
  13. return 0, false
  14. }
Add Comment
Please, Sign In to add comment