{"size": 360, "ext": "js", "max_stars_repo_path": "Algorithms/find-all-numbers-disappeared-in-an-array.js", "max_stars_repo_name": "Claude-Ray/LeetCode", "max_stars_repo_stars_event_min_datetime": "2018-05-07T09:17:31.000Z", "max_stars_repo_stars_event_max_datetime": "2019-01-22T08:33:03.000Z", "max_issues_repo_path": "Algorithms/find-all-numbers-disappeared-in-an-array.js", "max_issues_repo_name": "Claude-Ray/LeetCode", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "Algorithms/find-all-numbers-disappeared-in-an-array.js", "max_forks_repo_name": "Claude-Ray/LeetCode", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 2, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 22.5, "max_line_length": 46, "alphanum_fraction": 0.5416666667}
/**
 * @param {number[]} nums
 * @return {number[]}
 */
var findDisappearedNumbers = function (nums) {
  for (let i = 0; i < nums.length; i++) {
    const index = Math.abs(nums[i]) - 1;
    nums[index] = -Math.abs(nums[index]);
  }
  const result = [];
  for (let i = 0; i < nums.length; i++) {
    if (nums[i] > 0) result.push(i + 1);
  }
  return result;
};
