010 solution in js