Key to CSE341 Section #2 Problems 1. One possible solution appears below. fun twoSame([]) = false | twoSame([x]) = false | twoSame(x::y::rest) = (x = y) orelse twoSame(y::rest) 2. One possible solution appears below. fun stutter([]) = [] | stutter(x::xs) = x::x::stutter(xs); 3. One possible solution appears below. fun stutterString(str) = implode(stutter(explode(str))); 4. One possible solution appears below. fun isPrime(2) = true | isPrime(n) = let fun explore(m) = if m >= n then true else n mod m <> 0 andalso explore(m + 2) in n > 2 andalso n mod 2 <> 0 andalso explore(3) end; 5. One possible solution appears below. fun cycle(0, lst) = lst | cycle(n, lst) = cycle(n - 1, tl(lst) @ [hd(lst)]); 6. One possible solution appears below. fun cycle2(n, lst) = let fun loop(0, list, back) = list @ List.rev(back) | loop(n, x::xs, back) = loop(n - 1, xs, x::back) in loop(n, lst, []) end