Libraryless. Click here for Pure Java version (2685L/17K/63K).
!7 static S compress(S text) { L<S> lines = toLines(text); Set<S> set = new TreeSet<S>(lines); if (l(set) != 1) ret null; S line = lines.get(0); ret fromLines(litlist("expand with #1002223", str(l(lines)), line)); }
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: | 614 / 1008 |
Version history: | 2 change(s) |
Referenced in: | [show references] |