1 | static L<IntRange> findNCNNonStreaks(L l, F1<LS, Bool> pred) { |
2 | new L<IntRange> out; |
3 | int i = 1, n = l(l); |
4 | while (i < n) { |
5 | int j = i; |
6 | while (j < n && !isTrue(callF(pred, subList(l, j-1, j+2)))) j += 2; |
7 | if (j > i) |
8 | out.add(intRange(i, j-1)); |
9 | i = j+2; |
10 | } |
11 | ret out; |
12 | } |
Began life as a copy of #1018231
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: | #1018234 |
Snippet name: | findNCNNonStreaks |
Eternal ID of this version: | #1018234/1 |
Text MD5: | c2dd7880483ab809c725e339cb9fd0da |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2018-09-11 17:10:06 |
Source code size: | 302 bytes / 12 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 385 / 415 |
Referenced in: | [show references] |