Giter Site home page Giter Site logo

otobrglez / compression-puzzle Goto Github PK

View Code? Open in Web Editor NEW
14.0 14.0 47.0 243 KB

Attempts to crack the "compression puzzle".

Makefile 8.23% Nix 1.01% JavaScript 6.28% Python 16.39% Scala 2.60% Shell 1.02% Ruby 7.86% Go 2.77% F# 6.01% Clojure 0.81% Red 19.60% Kotlin 2.03% Haskell 0.93% Rust 0.84% Elixir 1.75% ReScript 1.09% TypeScript 5.39% C# 8.00% C++ 6.30% PHP 1.08%

compression-puzzle's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

compression-puzzle's Issues

Ambiguous Requirements with regards to double digit output

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.

Common test suite

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.

Python scripts don't seem to get invoked

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

Single character compressions

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

The "Wanted" Languages

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 ...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.