fork download
  1. (defn right_zeros
  2. [np]
  3. (loop [z 0 n np]
  4. (if (or (< n 10) (not= (mod n 10) 0))
  5. z
  6. (recur (inc z) (/ n 10)))))
  7.  
  8.  
  9. (println (right_zeros 123000))
  10. (println (right_zeros 102030))
  11. (println (right_zeros 123123))
  12. (println (right_zeros 10))
  13. (println (right_zeros 0))
  14. (println (right_zeros 1))
Success #stdin #stdout 1.69s 335552KB
stdin
Standard input is empty
stdout
3
1
0
1
0
0