mylast::[a]->[a]
mylast [] = error "no elem"
mylast [z] = [z]
mylast[z,y] = [y, z]
mylast [z, y, m] = [m,y,z]
mylast (z:y:m) = mylast m
mylast :: [a]->[a]
mylast [] = []
mylast [z] = [z]
mylast [z,y] = [y, z]
mylast [z, y, m] = [m,y,z]
mylast (z:y:m) = mylast m ++ [y,z]
mylast :: [a]->[a]
mylast (x:xs) = mylast xs ++ [x]
mylast [] = []