CountDistinctBy
CountDistinctBy[{e1,e2,…},f] gives the number of distinct values of f[ei] that occur.
CountDistinctBy[f] represents an operator form of CountDistinctBy that can be applied to an expression.
Please visit the official Wolfram Language Reference for more details and examples on core symbols.