  We study the problem of determining if the mode of the output distribution of
a quantum circuit given as a black-box is larger than a given threshold. We
design a quantum algorithm for a promised version of this problem whose space
complexity is logarithmic in the size of the domain of the distribution.
Developing on top of that we further design an algorithm to estimate the
largest probability among the outcomes of that circuit. This allows to revisit
a few recently studied problems in the few-qubits scenario, namely
$k$-distinctness and its gapped version, estimating the largest frequency in an
array, and estimating the min-entropy of a distribution. In particular, our
algorithm for $k$-distinctness on $n$-sized $m$-valued arrays requires $O(\log
n + \log m)$ qubits compared to $\Omega(poly(n))$ qubits required by all the
previous algorithms, and its query complexity is optimal for $k=\Omega(n)$. We
also study reductions between the above problems and derive better lower bounds
for some of them. The time-complexities of our algorithms have a small overhead
over their query complexities making them efficiently implementable on
currently available quantum backends.
