i have coded this solution it is passing some test cases but not all anyone having any idea please help;