Transpiled version (3981L) is out of date.
1 | static <A extends Set<S>> A addAndRemoveSomeRandomStrings(A set, int nAdd, int nRemove) { |
2 | repeat nAdd { |
3 | set.add(aGlobalID()); |
4 | } |
5 | var it = shuffledIterator(cloneList(set)); |
6 | while (nRemove-- > 0 && it.hasNext()) |
7 | set.remove(it.next()); |
8 | ret set; |
9 | } |
download show line numbers debug dex old transpilations
Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj
No comments. add comment
Snippet ID: | #1032633 |
Snippet name: | addAndRemoveSomeRandomStrings |
Eternal ID of this version: | #1032633/3 |
Text MD5: | b4b081563f644813abba767f282cbbd4 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2021-09-29 22:45:30 |
Source code size: | 268 bytes / 9 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 162 / 224 |
Version history: | 2 change(s) |
Referenced in: | [show references] |