Skip to content

Different approaches to solving coding challenges, along with explanations of the thinking involved.

Notifications You must be signed in to change notification settings

RamseyNjire/coding-challenges-solved-and-explained

Repository files navigation

Solutions to Coding Challenges with Explanations

Let's collect as many different solutions for coding challenges as we can! Better yet, let's try to explain them easily!

How to Use This Repo

  • Links to challenges are in the 'Challenges' column of the 'Challenges' table below.

  • The solutions can be found in the Solutions folder. Links are in the 'Solutions' column of the table below.

  • Code for various data structures and algorithms can be found in the 'Data Structures' and 'Algorithms' tables.

  • The explainers can be found in the Explainers folder, with more information in the EXPLAINERS.md

Hackerrank Challenges

Challenges Solutions Explainers
3D Surface Area Solution Explainer
Anagram Solution Explainer
Angry Professor Solution Explainer
Beautiful Triplets Solution Explainer
Birthday Cake Candles Solution Explainer
Cavity Map Solution Explainer
Chocolate Feast Solution Explainer
Divisible Sum Pairs Solution Explainer
Electronics Shop Solution Explainer
Encryption Solution Explainer
Equalize The Array Solution Explainer
Even Fibonacci Numbers Solution Explainer
Fair Rations Solution Explainer
Find Digits Solution Explainer
Find The Median Solution Explainer
FizzBuzz Solution Explainer
Game Of Thrones - I Solution Explainer
Grading Students Solution Explainer
Halloween Sale Solution Explainer
Lisa's Workbook Solution Explainer
Manasa And Stones Solution Explainer
Palindrome Index Solution Explainer
Picking Numbers Solution Explainer
Sock Merchant Solution Explainer
Staircase Solution Explainer
The Hurdle Race Solution Explainer
The Time In Words Solution Explainer

Codewars Challenges

Challenges Solutions Explainers
Abbreviate A Two Word Name Solution Explainer
Array Plus Array Solution Explainer
Beginner Series #1 School Paperwork Solution Explainer
Beginner Series #4 Cockroach Solution Explainer
Calculating With Functions Solution Explainer
Century From Year Solution Explainer
Convert Number To Reversed Array Of Digits Solution Explainer
Count By X Solution Explainer
Count Letters In String Solution Explainer
Count The Monkeys! Solution Explainer
Don't Drink The Water Solution Explainer
Extract The Domain Name From A URL Solution Explainer
Fake Binary Solution Explainer
Find The First Non-Consecutive Number Solution Explainer
First Non-Repeating Character Solution Explainer
Get The Mean Of An Array Solution Explainer
How Good Are You Really? Solution Explainer
Human Readable Duration Format Solution Explainer
Interleaving Arrays Solution Explainer
Invert Values Solution Explainer
Jenny's Secret Message Solution Explainer
Keep Hydrated! Solution Explainer
Lottery Ticket Solution Explainer
Memoized Fibonacci Solution Explainer
Multiplying Numbers As Strings Solution Explainer
Permutations Solution Explainer
RGB To Hex Conversion Solution Explainer
(Ready for) Prime Time Solution Explainer
Returning Strings Solution Explainer
Reversed Sequence Solution Explainer
Snail Solution Explainer
Sort Arrays - 3 Solution Explainer
String Incrementer Solution Explainer
Sum Arrays Solution Explainer
Sum Of Intervals Solution Explainer
Sum Without Highest And Lowest Number Solution Explainer
The Hashtag Generator Solution Explainer
Total Amount Of Points Solution Explainer
Valid Parentheses Solution Explainer
You Can't Code Under Pressure #1 Solution Explainer

Data Structures and Algorithms

Data Structures

Data Structure Code Explainers
Array N/A Explainers
Singly Linked List Code Explainers
Doubly Linked List Code Explainers

🀝 Contributing

  • Contributions are welcome. Fork the project, make changes, then make a pull request.

  • If you're going to suggest a new coding challenge to include on the list, then include your solution along with the coding challenge. Make sure your solution is in the appropriate language folder. Include a link to the coding challenge in the top-level README before making your pull request, and make sure it is passing all test cases.

  • If you're going to suggest a new solution to a coding challenge that already has an existing solution in the repo, make sure it fulfils at least one of the following:

    • Has better time complexity than the existing solution
    • Has the same time complexity but involves writing less code
    • Is well commented to explain what is going on
  • Optionally, consider writing a short article or making an explainer video where you explain how the algorithm works and the thinking process that led you to that particular solution. I am currently trying to do write-ups for all of my solutions to make these algorithms more accessible and would love assistance on the same. You can add your explanation to the any of the EXPLAINER-*.md documents.

  • To suggest a new challenge to add to the list, add it to the (CHALLENGES.md)[./Challenges/CHALLENGES.md] file with a link to the webpage with the challenge. Ideally, the page should have test cases to verify. In case your challenge does not have test cases, please provide test cases along with your challenge.

Show your support

Give a ⭐️ if you like this project!

πŸ“ License

This project is MIT licensed.

About

Different approaches to solving coding challenges, along with explanations of the thinking involved.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published