Available question text
Find the k distinct characters whose counts f(c) in s maximize the sum (beauty), then count how many k-length subsequences (distinct index choices) realize that maximum by resolving ties combinatorially. This reduces to frequency counting, sorting/selecting top-k frequencies, and using combinations/products of f(c) with modular arithmetic to handle tied frequencies.
Related questions
Continue with questions that share topics or the same question type.
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 2842. Count K-Subsequences of a String With Maximum Beauty
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source