Libraryless. Click here for Pure Java version (2553L/16K).
1 | static L<IntPair> overlappingIntPairs(L<Int> l) {
|
2 | new L<IntPair> out; |
3 | Iterator<Int> it = iterator(l); |
4 | if (!it.hasNext()) ret out; |
5 | int a = it.next(); |
6 | while (it.hasNext()) {
|
7 | int b = it.next(); |
8 | out.add(IntPair(a, b)); |
9 | a = b; |
10 | } |
11 | ret out; |
12 | } |
Began life as a copy of #1014575
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
| Snippet ID: | #1028205 |
| Snippet name: | overlappingIntPairs |
| Eternal ID of this version: | #1028205/3 |
| Text MD5: | 72abd0eaeee56644679ed529f44c029f |
| Transpilation MD5: | 1748d177d4f8990f87c1920ce8ceee12 |
| Author: | stefan |
| Category: | javax |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2020-05-26 13:22:02 |
| Source code size: | 271 bytes / 12 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 394 / 527 |
| Version history: | 2 change(s) |
| Referenced in: | [show references] |