Nota: podeu fer servir la funció .indexOf, que donat un vector i un valor:
retorna l’índex on aquest valor apareix per primer cop en el vector, o −1 si el valor no hi és dins el vector.
Input
(number-of-rotations [10 2 4 6]) (number-of-rotations [7 8 10 2 3 4 5 6]) (number-of-rotations [2 3 4 5 6])
Output
1 3 0
Input
(fsmap 3 [(fn [x] (+ 2 x)) (fn [x] (* 3 x)) (fn [x] (+ 4 x))])
Output
(3 5 15 19)