Tell us what’s happening:
all my cases are getting verified except, ```
mutation([“voodoo”, “no”])
it’s returning true when it’s supposed to written false, my counter is taking into account those extra o’s and that’s passing the condition even there’s no “no” in “voodoo”, how do I go about this
Counting the number of timess2Split[i]===s1Split[j] is true is not the correct approach to this problem because of the very issue you are seeing with mutation(["voodoo", "no"]). One approach that would use the nested for loop structure you have is for each letter being iterated over of the second argument to use a Boolean flag variable initialized to false within the first for loop. Then, within the nested for loop if s2Split[i]===s1Split[j] is true, you know you found one of the letters, so you can set the flag variable to true.
After the nested for loop completes, you check if the flag variable is false. If it is, then you can go ahead and return false, since you know one of the letters was not found. After both for loops have completed, you know every letter was found because the function never returned false (and exited), so you can simply return true at the end of the function.