{"id":18631752,"url":"https://github.com/esotericpig/codewars","last_synced_at":"2025-04-11T06:32:21.788Z","repository":{"id":96103833,"uuid":"139547283","full_name":"esotericpig/codewars","owner":"esotericpig","description":":space_invader::school_satchel::neckbeard: My codewars solutions: Ruby, Java, Python, C++, JavaScript, Crystal, Kotlin, CoffeeScript, PHP, Objective-C.","archived":false,"fork":false,"pushed_at":"2024-07-13T21:49:29.000Z","size":179,"stargazers_count":9,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-25T10:42:29.184Z","etag":null,"topics":["algorithm-challenges","algorithms","codewars","codewars-solutions","katas"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/esotericpig.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-07-03T07:47:59.000Z","updated_at":"2025-03-14T07:54:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"1809b1a1-da2d-4a06-9190-7f40891986e4","html_url":"https://github.com/esotericpig/codewars","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esotericpig%2Fcodewars","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esotericpig%2Fcodewars/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esotericpig%2Fcodewars/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esotericpig%2Fcodewars/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/esotericpig","download_url":"https://codeload.github.com/esotericpig/codewars/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248356471,"owners_count":21090221,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["algorithm-challenges","algorithms","codewars","codewars-solutions","katas"],"created_at":"2024-11-07T05:08:30.828Z","updated_at":"2025-04-11T06:32:21.521Z","avatar_url":"https://github.com/esotericpig.png","language":"Java","readme":"# codewars\n[![Codewars Badge | esotericpig](https://www.codewars.com/users/esotericpig/badges/large)](https://www.codewars.com/users/esotericpig)\n\nThis repo contains my solutions from [codewars](https://www.codewars.com/users/esotericpig).\n\nNot all of my solutions are listed. A solution will be listed if it is...\n\n- Interesting and/or difficult or\n- I am learning the language, so I want to have a reference to the code, even if it's trivial.\n\nMy coding style here is a bit hackier. Oftentimes, I also try to make it smaller, at the expensive of efficiency, so it is not 100% what I would use in production. However, I did try to make the code readable.\n\nFor most (or all) solutions, I added the test cases into \"main\" (or outside) so that it can be run by itself. I also added additional comments and/or modified the code slightly, so it is not 100% what I submitted.\n\nEnjoy :)\n\n## Contents\n[ [Notes](#notes) | [Favorites](#favorites) | [By Rank](#by-rank) | [Running](#running) | [License](#license) ]\n\n## [Notes](#contents)\n- Sometimes, there is *file2*, *file3*, etc. These are multiple solutions I submitted. Oftentimes, *2*, *3*, etc. are hackier, while the original is less hacky.\n- For Java solutions, I sometimes renamed the files/classes so that there would not be conflicts and the names would be more descriptive.\n\n## [Favorites](#contents)\n- [ruby/ten_pin_bowling.rb](ruby/ten_pin_bowling.rb)\n- [java/SecretDetective.java](java/SecretDetective.java)\n- [java/PokerHand.java](java/PokerHand.java)\n- [ruby/pyramid_slide_down.rb](ruby/pyramid_slide_down.rb)\n- [ruby/pyramid_slide_down2.rb](ruby/pyramid_slide_down2.rb)\n- [ruby/roman_numerals_helper2.rb](ruby/roman_numerals_helper2.rb)\n- [ruby/roman_numerals_helper3.rb](ruby/roman_numerals_helper3.rb)\n- [java/AssemblerInterpreterPartII2.java](java/AssemblerInterpreterPartII2.java)\n- [java/AssemblerInterpreterPartII3.java](java/AssemblerInterpreterPartII3.java)\n- [python/hard_sudoku_solver.py](python/hard_sudoku_solver.py) [ [gif](pics/python_hard_sudoku_solver.gif) ]\n\n## [By Rank](#contents)\nGenerated by [ls_rank.rb](ls_rank.rb) (Ruby v2.4+ required).\n\n[ [2 kyu](#2-kyu) | [3 kyu](#3-kyu) | [4 kyu](#4-kyu) | [5 kyu](#5-kyu) | [6 kyu](#6-kyu) | [7 kyu](#7-kyu) ]\n\n- ### [2 kyu](#by-rank)\n    - [java/AssemblerInterpreterPartII.java](java/AssemblerInterpreterPartII.java)\n    - [java/AssemblerInterpreterPartII2.java](java/AssemblerInterpreterPartII2.java)\n    - [java/AssemblerInterpreterPartII3.java](java/AssemblerInterpreterPartII3.java)\n\n- ### [3 kyu](#by-rank)\n    - [java/Psychic.java](java/Psychic.java)\n    - [python/hard_sudoku_solver.py](python/hard_sudoku_solver.py) [ [gif](pics/python_hard_sudoku_solver.gif) ]\n    - [python/sudoku_solver.py](python/sudoku_solver.py)\n\n- ### [4 kyu](#by-rank)\n    - [java/Finder.java](java/Finder.java)\n    - [java/Finder2.java](java/Finder2.java)\n    - [java/PokerHand.java](java/PokerHand.java)\n    - [java/SecretDetective.java](java/SecretDetective.java)\n    - [java/Snail.java](java/Snail.java)\n    - [ruby/catching_car_mileage_numbers.rb](ruby/catching_car_mileage_numbers.rb)\n    - [ruby/pyramid_slide_down.rb](ruby/pyramid_slide_down.rb)\n    - [ruby/pyramid_slide_down2.rb](ruby/pyramid_slide_down2.rb)\n    - [ruby/roman_numerals_helper.rb](ruby/roman_numerals_helper.rb)\n    - [ruby/roman_numerals_helper2.rb](ruby/roman_numerals_helper2.rb)\n    - [ruby/roman_numerals_helper3.rb](ruby/roman_numerals_helper3.rb)\n    - [ruby/simplifying_multilinear_polynomials.rb](ruby/simplifying_multilinear_polynomials.rb)\n    - [ruby/ten_pin_bowling.rb](ruby/ten_pin_bowling.rb)\n    - [ruby/the_observed_pin.rb](ruby/the_observed_pin.rb)\n    - [ruby/validate_sudoku_with_size_nxn.rb](ruby/validate_sudoku_with_size_nxn.rb)\n\n- ### [5 kyu](#by-rank)\n    - [crystal/number_to_english.cr](crystal/number_to_english.cr)\n    - [java/SimplePigLatin.java](java/SimplePigLatin.java)\n    - [javascript/human_readable_time.js](javascript/human_readable_time.js)\n    - [ruby/calc_with_funcs.rb](ruby/calc_with_funcs.rb)\n    - [ruby/did_you_mean.rb](ruby/did_you_mean.rb)\n    - [ruby/double_cola.rb](ruby/double_cola.rb)\n    - [ruby/josephus_survivor.rb](ruby/josephus_survivor.rb)\n\n- ### [6 kyu](#by-rank)\n    - [cpp/build_tower.cc](cpp/build_tower.cc)\n    - [cpp/highest_scoring_word.cc](cpp/highest_scoring_word.cc)\n    - [crystal/buying_a_car.cr](crystal/buying_a_car.cr)\n    - [java/BraceChecker.java](java/BraceChecker.java)\n    - [java/LengthOfMissingArray.java](java/LengthOfMissingArray.java)\n    - [javascript/counting_duplicates.js](javascript/counting_duplicates.js)\n    - [javascript/data_compress_using_rle.js](javascript/data_compress_using_rle.js)\n    - [javascript/data_compress_using_rle2.js](javascript/data_compress_using_rle2.js)\n    - [kotlin/a_plus_b_equals_123.kts](kotlin/a_plus_b_equals_123.kts)\n    - [objective-c/follow_that_spy.m](objective-c/follow_that_spy.m)\n    - [php/equal_sides_of_an_array.php](php/equal_sides_of_an_array.php)\n    - [python/who_likes_it.py](python/who_likes_it.py)\n\n- ### [7 kyu](#by-rank)\n    - [coffeescript/breaking_chocolate_problem.coffee](coffeescript/breaking_chocolate_problem.coffee)\n    - [java/CircularList.java](java/CircularList.java)\n    - [ruby/credit_card_mask.rb](ruby/credit_card_mask.rb)\n    - [ruby/easy_wallpaper.rb](ruby/easy_wallpaper.rb)\n\n## [Running](#contents)\n\nThis is how I (compile and) run these solutions on my system ([Fedora](https://getfedora.org/)).\n\nThe language version is usually just behind the latest version.\n\nIf you're familiar with `Rake`, you can alternatively use this:\n\n```\n$ rake -T\n\n$ rake build -- cpp/build_tower.cc\n$ rake run -- cpp/build_tower.cc 33\n\n$ rake build -- java/SimplePigLatin.java\n$ rake run -- java/SimplePigLatin.java 'Monkey Burger'\n\n### Dry run.\n$ rake clean[t]\n### Actually clean.\n$ rake clean\n```\n\n- CoffeeScript:\n    - `$ sudo npm install --global coffeescript`\n    - `$ coffee \u003cname\u003e.coffee \u003cargs\u003e`\n- Crystal:\n    - `$ curl https://dist.crystal-lang.org/rpm/setup.sh | sudo bash`\n    - `$ sudo dnf install crystal`\n        - Alternatively:\n        - `$ sudo snap install crystal --classic`\n    - `$ crystal \u003cname\u003e.cr \u003cargs\u003e`\n- C++:\n    - I use a file extension for [.gitignore](.gitignore).\n    - `$ sudo dnf install gcc-c++`\n    - `$ g++ \u003cname\u003e.cc -o \u003cname\u003e.out`\n    - `$ ./\u003cname\u003e.out \u003cargs\u003e`\n- Java:\n    - `$ sudo dnf install java`\n    - `$ javac \u003cName\u003e.java`\n    - `$ java \u003cName\u003e \u003cargs\u003e`\n- JavaScript:\n    - `$ sudo dnf install nodejs`\n    - `$ node \u003cname\u003e.js \u003cargs\u003e`\n- Kotlin:\n    - `$ sudo snap install --classic kotlin`\n    - `$ kotlinc -script \u003cname\u003e.kts \u003cargs\u003e`\n- Objective-C:\n    - Don't bother...it's a huge pain....\n- PHP\n    - `$ sudo dnf install php`\n    - `$ php \u003cname\u003e.php \u003cargs\u003e`\n- Python:\n    - `$ sudo dnf install python3`\n    - `$ python3 \u003cname\u003e.py \u003cargs\u003e`\n- Ruby:\n    - `$ sudo dnf install ruby`\n    - `$ ruby \u003cname\u003e.rb \u003cargs\u003e`\n\n## [License](#contents)\n[GNU GPL v3+](LICENSE)\n\nI did not add the license to the top of each file, because I wanted the files to be small and quickly viewable (like scripts). However, every file in this repo is under this license, so do not be afraid to use any of the code here in a project that is compatible with this license.\n\n\u003e codewars (https://github.com/esotericpig/codewars)  \n\u003e Copyright (c) 2018-2021 Bradley Whited  \n\u003e \n\u003e codewars is free software: you can redistribute it and/or modify  \n\u003e it under the terms of the GNU General Public License as published by  \n\u003e the Free Software Foundation, either version 3 of the License, or  \n\u003e (at your option) any later version.  \n\u003e \n\u003e codewars is distributed in the hope that it will be useful,  \n\u003e but WITHOUT ANY WARRANTY; without even the implied warranty of  \n\u003e MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the  \n\u003e GNU General Public License for more details.  \n\u003e \n\u003e You should have received a copy of the GNU General Public License  \n\u003e along with codewars.  If not, see \u003chttp://www.gnu.org/licenses/\u003e.  \n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fesotericpig%2Fcodewars","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fesotericpig%2Fcodewars","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fesotericpig%2Fcodewars/lists"}