• + 0 comments

    javaScript:

    function gemstones(arr) {
        // Write your code here
        let count=0;
        let minerals=""
        let str=arr.join("");
        
        for(let i of str){
            if(!minerals.includes(i)){
                 minerals+=i
            }
        }
        
        for (let i of minerals){
            let skip=false
            for(let j of arr){
                if(!j.includes(i)){
                    skip=true
                    break;
                }  
            }
            if(skip==false){
                count++  
            }
        }
        return count
    }