Writing code for 2 & 3 would probably take more than solving it with pen&paper, for me at least. I wrote code for #1 because it was practically 3 lines..
If it was really meant as a programming challenge, it should feature problems which are worth writing code for.
If it was really meant as a programming challenge, it should feature problems which are worth writing code for.