1 | static <A> bool allDifferent(Iterable<A> l) { |
2 | if (l == null) true; |
3 | new HashSet<A> set; |
4 | for (A a : l) |
5 | if (!set.add(a)) false; |
6 | true; |
7 | } |
download show line numbers debug dex old transpilations
Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1017083 |
Snippet name: | allDifferent |
Eternal ID of this version: | #1017083/4 |
Text MD5: | 43d81a2eb3a02718fcaddde5ce0d02d1 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2018-07-11 20:46:48 |
Source code size: | 150 bytes / 7 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 383 / 418 |
Version history: | 3 change(s) |
Referenced in: | [show references] |