I’m trying to learn Clojure and Functional Programming in general, and for this I’m tring to resolve exercises from Codingbat. I’m stuck when I have to find a subarray [1 2 3] from another sub array. from the page:
Given an array of ints, return True if .. 1, 2, 3, .. appears in the
array somewhere.
I would love, not the answer per se, but the ideas of how could I solve. Well, that’s almost equal to the answer but any idea will be fine.
Thanks.
With a combination of
someandpartition:Note that the above does not return a boolean result (but it can still be used as test in conditionals). If you really want a boolean result you can use
boolean