Strongest fighter

can anyone tell me what is the problem with this code? I have tested it on many test cases, seems to work fine but cannot pass the test cases on the site.