Table of contents
Leet code question
Example 1: Input: nums = [1,2,3,1] Output: true Example 2: Input: nums = [1,2,3,4] Output: false Example 3: // code function containsDuplicate(nums){ // creating set using nums const isDuplicate=new Set(nums); // checking if created set and nums length are eqaul if(isDuplicate.size===nums.length){ return false; } return true; }