Good question demands better understanding
Actually what the question demand you need to do it ,\nas if any no is not valid then it cant be the ans as the same array will be formed again ,\nso dont remov
Actually what the question demand you need to do it ,\nas if any no is not valid then it cant be the ans as the same array will be formed again ,\nso dont remove and add anything and secondly its gauranteed that answer exist so if not get the ans then the last one will be the answer,\nso dont need to run loop for k times instead run it for nums.length\n\n```\nclass Solution {\n    public int getWinner(int[] arr, int k) {\n       \n       int winner =arr[0];\n        int count=0;\n        for(int i=1;i<arr.length;i++)\n        {\n                if(winner>arr[i])\n                    count++;\n                else\n                {\n                    winner=arr[i];\n                    count=1;\n                }\n            if(count==k)\n                return winner;\n        }\n        return winner;\n    }\n}\n```
['Java']