Skip to content
Browse files

Fixing pandigital fn

  • Loading branch information...
1 parent 59d7a21 commit 4f351fee7a1e3f718f8f8661a2a825a5477e52a2 @jdunphy committed Jan 8, 2013
Showing with 6 additions and 8 deletions.
  1. +6 −8 clojure/pandigital.clj
View
14 clojure/pandigital.clj
@@ -1,11 +1,9 @@
(ns pandigital)
-(defn pandigital? [n]
- (let [n-string (sort (Integer/toString n))]
- n-string
- ))
+(defn pandigital? [numbers]
+ "Returns true if input numbers are 1-9 pandigital. Input: list of numbers"
+ (= (apply str (sort (apply str numbers))) "123456789"))
-(defn n-len-valid-pan [n]
- )
-
-(pandigital/pandigital? 3245)
+(pandigital/pandigital? '(3245)) ;false
+(pandigital/pandigital? [123 45 67 98]) ;true
+(source pandigital/pandigital?)

0 comments on commit 4f351fe

Please sign in to comment.
Something went wrong with that request. Please try again.