JS solutions that work for Problem 27,35. Solution that's too slow for Problem 58