static <A> void replaceRandomElement(L<A> l, A newElement) { if (empty(l)) ret; l.set(random(l(l)), newElement); }
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Snippet ID: | #1014941 |
| Snippet name: | replaceRandomElement |
| Eternal ID of this version: | #1014941/1 |
| Text MD5: | 64f8e141ccf6ab28197a4f7f06fdb648 |
| Author: | stefan |
| Category: | javax |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2018-05-06 16:45:10 |
| Source code size: | 121 bytes / 4 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 704 / 733 |
| Referenced in: | #1006654 - Standard functions list 2 (LIVE, continuation of #761) |