Given a list of mineral frequencies, write a function to determine the count of distinct minerals.
Explanation: Step-by-step: with input [1, 2, 3, 2, 1], we convert the list to a set to remove duplicates, resulting in {1, 2, 3}. The size of the set is 3, giving output 3.
Explanation: Step-by-step: with input [1, 1, 1, 1, 1], we convert the list to a set to remove duplicates, resulting in {1}. The size of the set is 1, giving output 1.
Analyze constraints and compute optimal solutions step-by-step.
No dry run loaded.
🚀 Practice this problem
Run code, get AI hints & track streak