You are viewing a single comment's thread. Return to all comments →
One line in ES6 JavaScript:
console.log( new Set(input.toLowerCase() .split('\n') .slice(1) .map(rock => rock.split('')) .reduce((prev, curr) => curr.filter(element => prev.includes(element))) ).size );
Not as minimal as Python but it's getting there :)
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 →
One line in ES6 JavaScript:
Not as minimal as Python but it's getting there :)