Skip to content

Instantly share code, notes, and snippets.

Last active April 28, 2021 14:31
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Apropos Clojure - April 28, 2021

Show Notes


State of Clojure 2021


JS Class and Template literals (in ClojureScript via Shadow CLJS)


String difference

You are given two strings, a and b. We consider each letter to be unique, meaning duplicates are significant. Write a function that returns the count of letters in b which do not occur in a.


(strdiff "abc" "") ;=> {} ;; no characters in b don't occur in a
(strdiff "abc" "abc") ;=> {} ;; ditto
(strdiff "" "abc") ;=> {\a 1 \b 1 \c 1}
(strdiff "axx" "abcc") ;=> {\b 1 \c 2}
(strdiff "xxxx" "xxxxxx") ;=> {\a 2} ;; two x's in b that don't occur in a

Thanks to this site for the challenge idea where it is considered Hard in Python. The problem has been modified from the original.

From Newsletter 419

Where to join us

Discord - Join if you want to watch us live or chat!

Recording and playback on YouTube -

Follow us on Twitter for updates -

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment