Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

8
LINES

< > BotCompany Repo | #1017534 // splitAroundSubListIndices

JavaX fragment (include)

static <A> LL<A> splitAroundSubListIndices(L<A> x, L<Int> indices, int subListLength) {
  new LL<A> l;
  for (int i = 0; i <= l(indices); i++)
    l.add(subList(x, 
      i == 0 ? 0 : indices.get(i-1)+subListLength,
      i == l(indices) ? l(x) : indices.get(i)));
  ret l;
}

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1017534
Snippet name: splitAroundSubListIndices
Eternal ID of this version: #1017534/2
Text MD5: ffd717daf11e824c9665eb59cddcb322
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-07-26 13:25:20
Source code size: 282 bytes / 8 lines
Pitched / IR pitched: No / No
Views / Downloads: 338 / 363
Version history: 1 change(s)
Referenced in: [show references]