Auction.com interview question

solving a problem using javascript