014 solution in js