Untitled

From Big Frog, 2 Weeks ago, written in Plain Text, viewed 14 times.
URL http://codebin.org/view/e1e05dad Embed
Download Paste or View Raw
  1. class Solution {
  2.     public List<Integer> findDisappearedNumbers(int[] nums) {
  3.         int n=nums.length;
  4.         List<Integer> ans = new ArrayList<>();
  5.         for(int i=1;i<=n;i++)
  6.             ans.add(i);
  7.         for(int i=0;i<n;i++)
  8.         {
  9.             ans.remove(new Integer(nums[i]));
  10.         }
  11.         return ans;
  12.     }
  13. }

Reply to "Untitled"

Here you can reply to the paste above