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

4
LINES

< > BotCompany Repo | #1002218 // lastN - take last n elements from list - returns new list

JavaX fragment (include)

static <A> L<A> lastN(L<A> l, int n) {
  int i = max(l(l)-n, 0);
  ret cloneList(subList(l, i));
}

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: #1002218
Snippet name: lastN - take last n elements from list - returns new list
Eternal ID of this version: #1002218/1
Text MD5: 8effbaf4e5219ca113b2718b3ba6900e
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2015-12-28 21:16:27
Source code size: 101 bytes / 4 lines
Pitched / IR pitched: No / Yes
Views / Downloads: 686 / 930
Referenced in: [show references]