4 ms·
I agree with the other comments which mentioned that Clojure is more flexible here (works with any seq, not just character strings). A similar Java code would h
by cema 15y ago
I agree with the other comments which mentioned that Clojure is more flexible here (works with any seq, not just character strings). A similar Java code would have to accept an enumerable parameter (not sure what it is in java, something like IEnumerable in .NET) and the loop would change accordingly. The loop-less regex version would not work (it might with the input converted to a string, which may or may not involve a explicit loop, depending on what is available in java ecosystem).