Hi guys , recently I tried to accept this question but was partially successful in my approach (30 points only). I have tried all my efforts but could not reduce the complexity of my code .Any help or suggestion will be highly appreciated .Thanks in advanvce .