My-Coderbyte-Solutions
My-Coderbyte-Solutions copied to clipboard
Sharing my solutions to Coderbyte Challenges with well-commented code!
My-Coderbyte-Solutions
If you need help with Coderbyte's Easy or Medium Challenges, you've come to the right place! I've laid out all my solutions with well-commented code as a resource for any programmer to follow along.
Background
After finishing Codecademy and Code School's Javascript courses, I was disappointed that I could barely tackle the easiest Coderbyte Challenges. It turns out that most online Javascript courses are great for learning syntax, but they don't teach problem-solving skills. I hope that by sharing my solutions and thought process for each problem that you can pick up some common (and not so common!) strategies and, most importantly, understand why these strategies work.
Pro Tip
Before proceeding further on your Coderbyte journey, I highly recommend learning the native string, number and array methods ASAP. These are your basic tools in your toolbox for problem-solving. I personally created flash cards so that if given a name, I could tell you what the method does, and if given what the method does, I could tell you the name. At a minimum, this will improve your recognition of all methods, and recognition is VITAL to both navigating paths to solutions and knowing where to look when you're stuck.
String methods: http://www.w3schools.com/js/js_string_methods.asp
Number methods: http://www.w3schools.com/js/js_number_methods.asp
Array methods: http://www.w3schools.com/js/js_array_methods.asp
Additional Pro Tips
-
Get comfortable converting between the various data types. For example, you will often need to convert a number into a string with .toString(), a string into an array with .split(''), an array into a string with .join(''), and so on.
-
Stack Overflow is your friend! Almost any question you'll have as a beginner or intermediate programmer has already been answered there.
-
Strings are immutable, which means they cannot be modified as is. Arrays are mutable and can be modified in place, so you will often convert to an array to change the way a string looks.
-
You will often need to keep track of how many times an event occurs with a "counter" variable initialized to 0 that increases by 1 every time we satisfy a condition. We usually place it outside of loops because otherwise the counter is reset to 0 upon every loop!
-
Regular expressions (abbreviated as "regex" or "RegExp") show up early on in the top solutions to various problems. I've provided solutions without regex because of its complexity to learn and read. However, regex can be incredibly powerful as a search and replace tool, so if you'd like to give it a try, I recommend checking out this website: http://www.regexr.com/
Quick Note
If you notice any ways to improve one of my solutions, feel free to message me! I'd love to chat about modifying any of my code to make it more clear, readable or efficient.
Good luck on your journey, and happy coding!