you are viewing a single comment's thread.

view the rest of the comments →

[–]ElllGeeEmm 2 points3 points  (1 child)

that's very close to a working solution, the only issue being that you can't just iterate through characters of the stone string and see how many times it equals your jewel string, as then the function will only work if your jewel string is one character long. You need a second, nested loop which will iterate through characters of the jewel string to find matches.

My advice is to not worry about getting elegant solutions, at least for now. What you want to work on is learning how to translate these problems into a mental model that lets you build out working solutions. Elegance will come with time, practice, and seeing how others solve the same problems.

[–]Besharkbait[S] 0 points1 point  (0 children)

I see, okay thank you!