PasteRack.org
Paste # 55175
2019-06-10 18:29:39

Fork as a new paste.

Paste viewed 246 times.


Embed:

  1. #lang racket
  2.  
  3. (define (mountainClimb next total)
  4.     (cond
  5.     [(< total 0) -1]
  6.     [(string=? next "+") (+ total 1)]
  7.     [(string=? next "-") (- total 1)])
  8. )
  9.  
  10. (= 0 (foldr mountainClimb 0 '("+" "-")))

=>

#f