solutions for 3 problems - slow as hell