Problem 1: Nothing but the Truth [Elementary]
trueProblem 2: Simple Math [Elementary]
4| ;; Clojure lazy-seq function to generate n prime numbers. | |
| ;; It generates .5 million prime numbers in 20 secs using | |
| ;; the naive non-sieve algo | |
| ;; Author: Abhishek Gupta (@abhilater) | |
| (defn n-primes | |
| [] | |
| (filter (fn [num] | |
| (loop [end (int (Math/sqrt num)), div 2, re (rem num div)] | |
| (cond |
| ;; The Caesar Cipher implementation using Clojure Transducers | |
| ;; Author: Abhishek Gupta | |
| ;The Caesar Cipher | |
| ;Given a string, use transducers to: | |
| ; | |
| ;Filter out vowels and non-ASCII characters | |
| ;Filter out upper-case characters | |
| ;Rotate all remaining characters via a Caesar cipher, | |
| ;And reduce the rotated characters into a map counting the number of occurrences of each character. |
| ;; | |
| ;; NS CHEATSHEET | |
| ;; | |
| ;; * :require makes functions available with a namespace prefix | |
| ;; and optionally can refer functions to the current ns. | |
| ;; | |
| ;; * :import refers Java classes to the current namespace. | |
| ;; | |
| ;; * :refer-clojure affects availability of built-in (clojure.core) | |
| ;; functions. |