Moduler solution, self explanatory names and methods.
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```java []\nclass Solution {\n    public int[] earliestAndLatest(int n, int firstPlayer, int secondPlayer) {\n        Finder finder=new Finder(n,firstPlayer,secondPlayer);\n        List<Integer> allPlayers=new ArrayList<>();\n        for(int i=0;i<n;i++){\n            allPlayers.add(i+1);\n        }\n        NoOfRounds finalRounds = finder.checkNoOfRounds(allPlayers);\n        return new int[]{finalRounds.minRound,finalRounds.maxRound};\n    }\n}\nclass Finder{\n    int firstPlayer,secondPlayer,n;\n    Finder(int n,int firstPlayer,int secondPlayer){\n        this.n=n;\n        this.firstPlayer=firstPlayer;\n        this.secondPlayer=secondPlayer;\n    }\n    NoOfRounds checkNoOfRounds(List<Integer> currPlayers){\n        if(theyCompete(currPlayers) || currPlayers.size()==1){\n            return new NoOfRounds(1,1);\n        }\n        List<List<Integer>> nextRounds=new RoundBuilder().buildNextRound(currPlayers,firstPlayer,secondPlayer);\n        int currMin=1000, currMax=0;\n        for(List<Integer> nextRound:nextRounds){\n            NoOfRounds fromThisRound=checkNoOfRounds(nextRound);\n            currMin=Math.min(currMin,fromThisRound.minRound);\n            currMax=Math.max(currMax,fromThisRound.maxRound);\n           // System.out.println(currMin+" "+currMax);\n        }\n        //System.out.println(currPlayers+" "+nextRounds);\n        return new NoOfRounds(currMin+1,currMax+1);\n    }\n    boolean theyCompete(List<Integer> currPlayers){\n        for(int i=0,j=currPlayers.size()-1;i<j;i++,j--){\n            if(isWinner(currPlayers.get(i)) && isWinner(currPlayers.get(j))){\n                return true;\n            }\n        }\n        return false;\n    }\n    boolean isWinner(int player){\n        return player==firstPlayer || player==secondPlayer;\n    }\n}\nclass RoundBuilder{\n    List<List<Integer>> allRounds=new ArrayList<>();\n    List<Integer> newRound,currPlayers;\n    int firstPlayer,secondPlayer;\n    List<List<Integer>> buildNextRound(List<Integer> currPlayers,int firstPlayer,int secondPlayer){\n        this.newRound=new ArrayList<>();\n        this.allRounds=new ArrayList<>();\n        this.currPlayers=currPlayers;\n        this.firstPlayer=firstPlayer;\n        this.secondPlayer=secondPlayer;\n        buildNextRound(0);\n        return allRounds;\n    }\n    void buildNextRound(int leftIndex){\n        int rightIndex=currPlayers.size()-1-leftIndex;\n        if(leftIndex>=rightIndex){\n            List<Integer> currRound=new ArrayList<>(newRound);\n            if(leftIndex==rightIndex){\n                currRound.add(currPlayers.get(leftIndex));\n            }\n            Collections.sort(currRound);\n            allRounds.add(currRound);\n            return;\n        }\n        int leftPlayer=currPlayers.get(leftIndex);\n        int rightPlayer=currPlayers.get(rightIndex);\n        if(rightPlayer!=firstPlayer && rightPlayer!=secondPlayer){\n            newRound.add(leftPlayer);\n            buildNextRound(leftIndex+1);\n            newRound.remove(newRound.size()-1);\n        }\n        if(leftPlayer!=firstPlayer && leftPlayer!=secondPlayer){\n            newRound.add(rightPlayer);\n            buildNextRound(leftIndex+1);\n            newRound.remove(newRound.size()-1);\n        }\n    }\n}\nclass NoOfRounds{\n    int minRound,maxRound;\n    NoOfRounds(int minRound,int maxRound){\n        this.minRound=minRound;\n        this.maxRound=maxRound;\n    }\n    public String toString(){\n        return minRound+" "+maxRound;\n    }\n}\n```
['Java']