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

5
LINES

< > BotCompany Repo | #1018000 - reverseGet - get from end of list

JavaX fragment (include)

static <A> A reverseGet(L<A> l, int idx) {
  if (l == null || idx < 0) null;
  int n = l(l);
  ret idx < n ? l.get(n-1-idx) : null;
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1018000
Snippet name: reverseGet - get from end of list
Eternal ID of this version: #1018000/1
Text MD5: 7ecc995fc76af750beefea614bb892ef
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-08-25 11:36:05
Source code size: 137 bytes / 5 lines
Pitched / IR pitched: No / No
Views / Downloads: 253 / 270
Referenced in: [show references]