const counter = (a_or_s) => { let m = new Map(); for (const x of a_or_s) m.set(x, m.get(x) + 1 || 1); return m; }; function findKth(a, n, k) { a.sort((x, y) => y - x); let m = counter(a), i = 1; for (const [x, occ] of m) { if (i >= k) { return x; } i...