Giter Club home page Giter Club logo

compression-puzzle's Introduction

The Compression Puzzle

The Compression Puzzle logo

GitHub Actions Status

One lovely Friday we were faced with this nice yet intriguing programming puzzle.

One shall write a program that compresses string "AAABBAAC" to its compressed form "3A2B2A1C".

These attempts were made,...

Basic rules

  1. No external libraries or tools shall be used. Only standard, bundled libraries apply.
  2. "Assert" inside your solution if the function does what it is suppose to do.
  3. You can apply as many solutions as you want to any language you want.
  4. Assume that the input is always a sequence of ASCII upper-case characters (no numbers or symbols).

Additional Q/A

Development

# Via Nix Shell
$ nix-shell shell.nix --run "make run"
# if you preffer to roll your own local brew
$ make

To run individual languages use:

make bash
make c++
make crystal
make clojure
make cs
make elixir
# ...
make php

Benchmarking

Although benchmarking is not the primary goal of this project; some authors are really kean to measure the performance of their solutions and compare them to others.

These languages have benchmarking suites made and feel free to give them a try.

# Python
python src/python/benchmarks.py

# F#
./src/fsharp/benchmark.fsx

# Crystal
./src/crystal/benchmark

P.s.: If you feel the urge that you need to benchmark your solution agains others; please feel free to do so and attach some instructions to your PR.

Authors

Author Solutions
Alex Piechowski Crystal
Aleš Justin Java
Andraž Brodnik Python
Bartłomiej Tomala Scala
Blaž Smolnikar PHP, Swift
Boleslav Březovský Red
Boris Red
David Kuridža Go
David Ličen JavaScript: compress_da01.js, compress_da02.js
Domen Gabrovšek JavaScript
Eran Ws JavaScript: compress_ew.js, compress_ew2.js
Goran Kodrun JavaScript, TypeScript
Gregg Irwin Red
Gregor Menih TypeScript
Gregor Petrin Groovy
Janko Metelko Rye: compress_jm_iter.rye, compress_jm_iter_steps.rye, compress_jm_rec.rye, compress_jm_rec_steps.rye, compress_js_hofs.rye, SQLite
Jernej Virag Kotlin
Kevin Meyer Assembler (x86)
Klemen Kogovšek JavaScript, ReScript
Krištof Črnivec Ruby: compress-kbc-0.rb, compress-kbc-1.rb
Lech Głowiak Scala
Luka Kacil Bash, Python: compress_luka.py, compress_luka_faster.py, compress_luka_rec1.py, compress_luka_rec2.py, compress_luka_tailrec.py
Luka Prebil Grintal JavaScript
Marek Fajkus Haskell
Miha Kloar TypeScript
Miha Novak Kotlin
Milan Slunečko Lua: compress.lua, compress-gsub.lua
Mitja Živković Go
Nace Štruc C#: Program.cs, Program.cs, Program.cs, MS SQL
Nejc Ilenič C++: compress_fast.cpp, compress_slow.cpp
Nejc Pušnik C#
Oto Brglez JavaScript, Python, Scala: CompressionPuzzle01.scala, CompressionPuzzle02.scala
Peter A. Pirc C#
Peter Keše F#: compress-pk1.fsx, compress-pk2.fsx, compress-pk3.fsx
Peter Levart Java
Primož Žnidar Ruby: compress_prima_1.rb, compress_prima_2.rb
Rob Cole Crystal
Rok Kreslin JavaScript
Roman Luštrik Python, R
Simon Belak Clojure
Simon Žlender Elixir: compress.exs, compress_rec.exs, Rust
Tit Petrič Go
Teodor Janez Podobnik Python
Tomaž Štih C
Urban Škudnik Python

The Stats 📈

  • The number of authors: 45
  • The number of solutions: 74
  • The number of programming languages: 29
  • The language / solutions breakdown: JavaScript: 10, Python: 10, C#: 5, Rye: 5, Ruby: 4, Scala: 4, Red: 3, F#: 3, Go: 3, TypeScript: 3, Crystal: 2, Kotlin: 2, Lua: 2, Java: 2, Elixir: 2, C++: 2, C: 1, Swift: 1, PHP: 1, Groovy: 1, SQLite: 1, Assembler (x86): 1, ReScript: 1, Bash: 1, Haskell: 1, MS SQL: 1, R: 1, Clojure: 1, Rust: 1

Language / Solutions Breakdown

compression-puzzle's People

Contributors

cjenp avatar davision avatar dorkamotorka avatar gmenih avatar gregopet avatar inejc avatar izacus avatar jankom avatar kev-m avatar kkogovsek avatar lglo avatar lknix avatar lukaprebil avatar mihanovak1024 avatar mkloar avatar mrchriss avatar nacestruc avatar otobrglez avatar pkese avatar plevart avatar rebolek avatar robcole avatar rokkreslincom avatar romunov avatar sbelak avatar smi11 avatar szlend avatar turbomack avatar uskudnik avatar zprima avatar

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.