Maximum Population Year Solution in C++
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)$$ -->\nO(n^2)\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\nO(1)\n# Code\n```\nclass Solution {\npublic:\n    int maximumPopulation(vector<vector<int>>& logs) {\n        int i, j, count=0, max=0, year=logs[0][0];\n        for(i=0 ; i<logs.size() ; i++)\n        {\n            count=0;\n            for(j=0 ; j<logs.size() ; j++)\n            {\n                if(logs[j][0]<=logs[i][0] && logs[i][0]<logs[j][1])\n                {\n                    count++;\n                }\n            }\n            if(count>max)\n            {\n                max = count;\n                year = logs[i][0];\n            }\n            else if(count==max && logs[i][0]<year)\n            {\n                year = logs[i][0];\n            }\n        }\n        return year;\n    }\n};\n```\n![upvote new.jpg](https://assets.leetcode.com/users/images/792a2ee3-fa92-4936-9a87-216cd9a9ac02_1682613207.1269994.jpeg)
['C++']