solved 044 but very slow
solved 045
solved 047