JavaScript algorithm not working

Printable View