Kata Tennis resolved using javascript