Solution that beasts 100% in javascript
So I submitted a solution for this problem which  beats 100% (Maybe because it is the first solution submitted written in javascript?)\n\nSo here is my thought 
So I submitted a solution for this problem which  beats 100% (Maybe because it is the first solution submitted written in javascript?)\n\nSo here is my thought process of how i solved this problem: If we look deeply into the problem, we can find that if we draw the timeline of the persons on top of each others we will notice that the **earliest year of the maximum population will always be the birthday of a person.**\n\nFor example given logs : [[1950,1960],[1955,1970],[1945,1958],[1953,1970]] we can get this graph:\n\n\n![image](https://assets.leetcode.com/users/images/aa27a19b-29af-456e-9d9b-c7921147f5d8_1620576284.735282.png)\n\n\n\nThe solution that I came up with is pretty easy; now all we need to do is to **iterate through the birthdays** and **calculate how many people are alive in that particular year.** then we save that information in an object containing the year as a key and the number of persons alive as a value.\n\nThe **result** then will be **the minimum key with the biggest value**.\n\nWe also need to be carful to not iterate through the same year twice.\n\nThe best result for the code below is **72ms / 38.9 MB** (beats 100% / 100%).\n```\nvar maximumPopulation = function (logs) {\n  let results = {};\n  for (let i = 0; i < logs.length; i++)\n    if (!results[logs[i][0]])\n      for (let j = 0; j < logs.length; j++)\n        if (logs[i][0] >= logs[j][0] && logs[i][0] < logs[j][1])\n          results[logs[i][0]] = (results[logs[i][0]] ? results[logs[i][0]] : 0) + 1;\n\n  return Object.keys(results).sort((a, b) => results[b] - results[a])[0];\n};\n```\nAnd please give me feedback about the solution and how to improve it!\nThanks.
['JavaScript']