SIMPLE PREFIX SUM + DIFFERENCE ARRAY C++ SOLUTION
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:o(m) where m is the no of logs \n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:o(1)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\n\nclass Solution {\npublic:\n    int maximumPopulation(vector<vector<int>>& logs){\n        vector<int>pref(2054);\n        for(auto&x : logs){\n            pref[x[0]]++;\n            pref[x[1]]--;\n        }\n         int maxi = 0;\n          int year = 0; \n        pref[0] = 0;\n        for(int i=1; i<pref.size(); i++){\n            pref[i]+=pref[i-1];\n        }\n        for(int i=1950; i<=2050; i++){\n            if(pref[i] > maxi){\n                maxi = pref[i];\n                year = i; \n            }\n        }\n        return year;\n    }\n};\n```
['C++']