012 solution in js