Win the Boxing Competition. Code it if you can.
There are two teams with 5 players each. Everyone has assigned their power score based on their performance and ability. At a time only two players can be in the ring. Your target is to make the appropriate pairing so that you can win the tournament or win the maximum matches if you are the captain of team B. Also calculate the maximum number of possible pairings Sample input: Enter Power of team A players: 12 16 43 35 22 Enter Power of team B players: 16 10 18 38 55 Sample output: Arrangement of team A players: 12 16 43 35 22 Arrangement of team B players: 16 18 10 38 55 Possible ways: 4 Explanation: Arrangement of team A players: 12 16 43 35 22 Arrangement of team B players: 16 18 10 38 55 & Arrangement of team A players: 12 16 43 35 22 Arrangement of team B players: 16 18 10 55 38 & Arrangement of team A players: 12 16 43 35 22 Arrangement of team B players: 16 18 55 38 10 & Arrangement of team A players: 12 16 43 35 22 Arrangement of team B players: 16 18 55 10 38 In all cases, Team B is winning 4 matches. and the tournament is won with the best possible score. Please upvote if you find this challenge interesting. Comment for any clarification.