added Dad's solution (written in C++ sorta)
fixed merge issue, added dad's solution.