Skip to content

Commit

Permalink
Added task 771.
Browse files Browse the repository at this point in the history
  • Loading branch information
thrashzone13 authored Nov 14, 2022
1 parent 46e6abd commit 4a4a1df
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/Algorithms/0771.jewels-and-stones/jewels-and-stones.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
class Solution {

/**
* @param String $jewels
* @param String $stones
* @return Integer
*/
function numJewelsInStones($jewels, $stones) {
$jewelsArr = str_split($jewels);
foreach($jewelsArr as $jewel) {
$b += substr_count($stones, $jewel);
}
return $b;
}
}

0 comments on commit 4a4a1df

Please sign in to comment.