problem 49 intial functions
problem 49 trying another approach
problem 49 solved