title: How can I just use high order functions to rewrite these (use Dr.Racket)
body: <p>This is my homework but we are only allowed to use <strong>filter, map, foldr, sort, build-list, and lambda instead of the explicit recursion</strong></p>
  <p>How can I rewrite these use those high order functions above to not let the function call itself.</p>
  <p>What I have now are these:</p>
  <pre><code>(define (worthless loc name)
    (cond
      [(empty? loc) loc]
      [(equal? name (coin-name (first loc))) (cons (make-coin (coin-name (first loc)) 0) (worthless (rest loc) name))]
      [else (cons (first loc) (worthless (rest loc) name))]))
  
  (define (working-group locations group-tz)
    (cond
      [(empty? locations) empty]
      [(and (equal? (utc-hours group-tz) (utc-hours (location-timezone (first locations)))) (equal? (utc-sign group-tz) (utc-sign (location-timezone (first locations)))))
       (cons (location-city (first locations)) (working-group (rest locations) group-tz))]
      [(and (equal? (add1 (utc-hours group-tz)) (utc-hours (location-timezone (first locations))))
            (equal? (utc-sign group-tz) (utc-sign (location-timezone (first locations))))
            (equal? (utc-mins group-tz) (utc-mins (location-timezone (first locations)))))
       (cons (location-city (first locations)) (working-group (rest locations) group-tz))]
      [(and (equal? (sub1 (utc-hours group-tz)) (utc-hours (location-timezone (first locations))))
            (equal? (utc-sign group-tz) (utc-sign (location-timezone (first locations))))
            (equal? (utc-mins group-tz) (utc-mins (location-timezone (first locations)))))
       (cons (location-city (first locations)) (working-group (rest locations) group-tz))]
      [else (working-group (rest locations) group-tz)])) ```
  </code></pre>