JavaScript code for PE problem 244 added.