problem 81 in javascript