otobrglez / compression-puzzle Goto Github PK
View Code? Open in Web Editor NEWAttempts to crack the "compression puzzle".
Attempts to crack the "compression puzzle".
Related to my comment #28 (comment)
there is slight ambiguity in output produce by the program. consider this input:
AAAAAAAAAAA
could produce 11A
now imagine digit in the input: 1
will produce 11
This means that output for the input 111x A sequence would be the same as for 1A
(111A
).
This is not a problem given there is only one simple example but it sort of makes it hard to say how would truly correct implementation look like.
It would make sense to run a common test suite against all the solutions through stdin or something like that. Either that or make the solutions also test the empty case (compress("") == ""
). I've ran into solutions where the empty case resulted in compress("") == "0"
while prototyping, and I wouldn't be surprised if some existing or future submissions had the same issue.
It seems python3 doesn't run scripts with
python3 src/python/*.py
like it's written in the make file. Maybe there is a more elegant solution but this works
find src/python/ -name "*.py" -print0 | xargs -0 -n 2 python3
In the example, There is only 1 C that gets compressed into 1C
. If we take the knowledge that all "multi character" will have a number, and all singles do not have this prefix number, we can improve the compression ratio of this problem
In what other languages would you like to see solutions, and do you know anyone who could provide them?
I would be interested to see Kotlin solution. There are probably some Android devs that use it. And Rust, and Julia ...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.