1 | static Set<Char> commonCharactersInStrings(L<S> l) { |
2 | Set<Char> set = null; |
3 | for (S s : l) { |
4 | new Set<Char> newSet; |
5 | for i over s: { |
6 | char c = s.charAt(i); |
7 | if (set == null || set.contains(c)) |
8 | newSet.add(c); |
9 | } |
10 | set = newSet; |
11 | } |
12 | ret set; |
13 | } |
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1014397 |
Snippet name: | commonCharactersInStrings |
Eternal ID of this version: | #1014397/2 |
Text MD5: | d443a49f02ef260518f822e1c80da013 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2018-04-21 13:11:35 |
Source code size: | 286 bytes / 13 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 417 / 445 |
Version history: | 1 change(s) |
Referenced in: | [show references] |