Skip to content

Instantly share code, notes, and snippets.

@samth
Created August 27, 2011 21:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samth/1175887 to your computer and use it in GitHub Desktop.
Save samth/1175887 to your computer and use it in GitHub Desktop.
Python Challenge problem #2
#lang at-exp racket
(define str
@string-append||{
;; giant wall of characters goes here
}||)
(define (frequencies l)
(for/fold ([h (hash)]) ([i l]) (hash-update h i add1 0)))
(define h (frequencies str))
(apply string
(for/list ([i str] #:when (= (hash-ref h i) 1)) i))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment