78 solved in python and cpp