We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
functiongemstones(arr){// Write your code hereletalp=arr[0].split('');letnewarr=newSet();for(letx=0;x<alp.length;x++){letfound=true;for(leti=1;i<arr.length;i++){if(arr[i].indexOf(alp[x])==-1){found=false;}}if(found){newarr.add(alp[x]);}}console.log(arr,newarr)returnnewarr.size;
}
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Gemstones
You are viewing a single comment's thread. Return to all comments →
JS:
}