Created
January 9, 2012 18:20
-
-
Save anonymous/1584218 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; jaskirat's solution to The Big Divide | |
;; https://4clojure.com/problem/148 | |
(fn [n a b] | |
(let [e #(quot (- n 1) %) | |
f #(* % (/ (* (e %) (inc (e %))) 2)) | |
x (f a) | |
y (f b) | |
z (f (* a b))] | |
(- (+ x y) z))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
this solution will get integer overflow. need to use +' and *'