Pset6 cs50 solution