Skip to content

Instantly share code, notes, and snippets.

@bcowell
Last active February 12, 2019 20:53
Show Gist options
  • Save bcowell/2624f1dc57b4d7ce49ca5bc26ca4fe0b to your computer and use it in GitHub Desktop.
Save bcowell/2624f1dc57b4d7ce49ca5bc26ca4fe0b to your computer and use it in GitHub Desktop.
28/01/2019 - 771. Jewels and Stones [Easy] bcowell
let J = "aA", S = "aAAbbbb"
let X = "z", Y = "ZZ";
const numJewelsInStones = (J, S) => {
return [...S].reduce((sum, s) => sum += J.includes(s), 0);
};
console.log( numJewelsInStones(J, S) );
console.log( numJewelsInStones(X, Y) );
@bcowell
Copy link
Author

bcowell commented Feb 12, 2019

Solution for leetcode 771. Jewels and Stones

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment