Libraryless. Click here for Pure Java version (5070L/28K).
static int[] randomSortedIntArray(int n, Random random default defaultRandomizer()) { new IntBuffer buf; for i to n: if (tossCoin(random)) buf.add(i+1); ret buf.toArray(); }
download show line numbers debug dex old transpilations
Travelled to 9 computer(s): bhatertpkbcr, iveijnkanddl, mowyntqkapby, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
Snippet ID: | #1029032 |
Snippet name: | randomSortedIntArray - n is max length, can be any shorter length too |
Eternal ID of this version: | #1029032/7 |
Text MD5: | 6496c8f6eab0483f27c114915440ce00 |
Transpilation MD5: | 69f25b34fe9e390dbc1a5a54cd84c425 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2021-12-26 16:14:05 |
Source code size: | 183 bytes / 5 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 247 / 384 |
Version history: | 6 change(s) |
Referenced in: | [show references] |