1 | static <A> MultiSet<A> stripMultiSetToTopTen(MultiSet<A> ms) { |
2 | ret stripMultiSetToTopTen(10, ms); |
3 | } |
4 | |
5 | static <A> MultiSet<A> stripMultiSetToTopTen(int n, MultiSet<A> ms) { |
6 | if (ms == null) null; |
7 | new MultiSet<A> ms2; |
8 | for (Pair<A, Int> p : topTenPairs(ms, n)) |
9 | ms2.add(p.a, p.b); |
10 | ret ms2; |
11 | } |
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1018141 |
Snippet name: | stripMultiSetToTopTen |
Eternal ID of this version: | #1018141/5 |
Text MD5: | 36a8b0936ee28a5bc374dfb01aff88d9 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2019-07-21 01:39:16 |
Source code size: | 309 bytes / 11 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 388 / 429 |
Version history: | 4 change(s) |
Referenced in: | [show references] |