Easy brute force
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```\npublic class MajorityChecker {\nint [] a;\n    public MajorityChecker(int[] arr) {\n        a=arr;\n    }\n    \n    public int Query(int l, int r, int t) {\n      int[]d= new int [20001];\n      for(int i=l; i<=r; i++){\n        d[a[i]]++;\n      }\n      for(int i=0; i<=20000; i++){\n        if(d[i]>=t) return i;\n      }\n      return -1;\n        \n    }\n}\n\n/**\n * Your MajorityChecker object will be instantiated and called as such:\n * MajorityChecker obj = new MajorityChecker(arr);\n * int param_1 = obj.Query(left,right,threshold);\n */\n```
['C#']