Libraryless. Click here for Pure Java version (2492L/16K).
1 | static S commonPrefixMulti(Iterable<S> l) { |
2 | Iterator<S> it = iterator(l); |
3 | if (!it.hasNext()) ret ""; |
4 | S s = it.next(); |
5 | while ping (it.hasNext()) { |
6 | s = commonPrefix(s, it.next()); |
7 | if (empty(s)) break; |
8 | } |
9 | ret s; |
10 | } |
Began life as a copy of #2000589
download show line numbers debug dex old transpilations
Travelled to 15 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
Snippet ID: | #1005052 |
Snippet name: | commonPrefixMulti |
Eternal ID of this version: | #1005052/4 |
Text MD5: | 5b741a3d42ceb25ef95368ff09afddff |
Transpilation MD5: | 81205569767bb1e3deea8cbe85383571 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2020-05-03 10:30:33 |
Source code size: | 240 bytes / 10 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 636 / 718 |
Version history: | 3 change(s) |
Referenced in: | [show references] |