Libraryless. Click here for Pure Java version (2685L/17K/63K).
1 | !7 |
2 | |
3 | static S compress(S text) { |
4 | L<S> lines = toLines(text); |
5 | Set<S> set = new TreeSet<S>(lines); |
6 | if (l(set) != 1) ret null; |
7 | S line = lines.get(0); |
8 | ret fromLines(litlist("expand with #1002223", str(l(lines)), line)); |
9 | } |
download show line numbers debug dex old transpilations
Travelled to 16 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, teubizvjbppd, tslmcundralx, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
Snippet ID: | #1002225 |
Snippet name: | Simple Text Compressor (handles only repetitions of a single line) |
Eternal ID of this version: | #1002225/3 |
Text MD5: | d12bc8cf09763f0ac2024e436601e9c9 |
Transpilation MD5: | 61e8a3cc7572054af28504154ee3d8ef |
Author: | stefan |
Category: | javax |
Type: | JavaX source code |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2020-05-25 12:56:09 |
Source code size: | 234 bytes / 9 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 615 / 1010 |
Version history: | 2 change(s) |
Referenced in: | [show references] |