Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

🧩 Kotlin coding puzzle and solutions

License

NotificationsYou must be signed in to change notification settings

igorwojda/kotlin-coding-challenges

Repository files navigation

This repository contains a set ofprogramming challenges that are intended to be solved by using theKotlin language (hints, solutions tests anduseful links are here as well).

The purpose of this repository is to help you to practice coding and develop strong problem-solving skills. This willhelp you to become a better programmer and improve your chance of getting a new job by passingwhiteboard coding interviews.

Challenge structure

Each challenge is located in a separate package, and it contains 3 mainfiles (screen):

  • README.md - the task description.
  • Challenge.kt - file containing an empty method/class where the challenge should be solved. This file also containsa set of tests and occasionally helper methods. You can run all tests directly from this file (click the green arrow next toTest class).JUnit tests which verify that the task was solved correctly.
  • Solution.kt - a file containing one or more solutions.

Keep in mind that each challenge will usually have more than one solution. Even simple challenges likeString reversal can be solved in10 different ways. Usually, we compare varioussolutions using(Big O notation) todetermine space/time complexity, and we look at code readability.

How do I start?

  1. InstallIntelliJ IDEA
  2. Import the project by using the IntelliJ IDEA menu:File | New | Project From Version Control | Git
  3. Choose a challenge (src\test\kotlin\com\igorwojda package) and codethe solution in theChallenge.kt file
  4. Run the tests in theChallenge.kt file to verify the provided solution

Let's solve some challenges

The challenges below are segregated by different difficulties. The repository also contains challenges grouped byproblem type.

Some challenges may contain a reference to other challenges that should be solved before to have a better understandingof the problem. Check thelook atproblem-solving strategy.

Take your time before you view the presented solution. To succeed you need to practice often, repeat the same challengesmultiple times and be persistent over time.

Good luck! 🤞

Beginner

Intermediate

Advanced

Expert

Troubleshoot

If you don't see the green play icon used to run the tests try to openSettings >Build, Execution, Deployment >Build tools >Gradle and setGradle JVM to a different version.

Useful links

More coding challenges

Challenges

  • GeeksForGeeks - large and nicely segregated set of problems.
  • HackerRank - a large set of problems and additional interview problems forbusiness.
  • LeetCode - data structures/algorithms/company interview problems segregatedby difficulty.
  • Exercism - coding challenge website that offers MANY challenges spanning over 60 programming languages.
  • Project Euler - more complex challenges, usually related to mathematics. The sitealready contains 600+ problems and a new code challenge is available every week or two. You will probably have todiscuss the problem with the community because solutions are not on the website.
  • Advent of code - one month of various programming problems released daily atthe end of the year. Fortunately, archive of past events is still there.
  • CoderByte - 200+ challenges, data structures/algorithms/company interviewproblems segregated by difficulty. Unfortunately, most of them are only available for premium users. Premium gives youaccess to premium step-by-step solutions and user solutions.
  • CodeChef - contains a set of programming problems segregated by difficulty.
  • Code Forces - list of programming challenges is smaller than other websites, butyou will still have plenty of problems to solve.
  • Spoj - list of programming challenges is smaller than other websites, butyou will still have plenty of problems to solve.

Game challenges

  • CodeWars - solve visual challenges by writing code for the.
  • CodinGame - solve visual challenges by writing code for the.

Video courses

Books

Websites

Coding interview repositories

Contribute

Feedback and new contributions are welcome whether it's through bug reports or new PRs. To add new coding challenges justfollow thisguide and open PR.

Author

Follow me

Follow me

License

MIT LicenseCopyright (c) 2023 Igor WojdaPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

🧩 Kotlin coding puzzle and solutions

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors23

Languages


[8]ページ先頭

©2009-2025 Movatter.jp