Loading the task…
Each string describes a rock’s composition, and each character represents an element found in it. The function gem_stones receives a list of strings arr. An element is considered a gem if it appears in every rock at least once. Return the number of such common characters.
["abcdde", "baccd", "eeabg"]2["abc", "abc", "abc"]3["ab", "cd"]0def gem_stones(arr: list[str]) -> int:
Sign in to see submission history
Sign inSign in to use AI Mentor
Sign inThey run when you press "Submit" — your whole solution is checked against them so you can't hard-code answers for the visible cases.