As a CS student at UCLA, securing a internship as soon as possible was something that I felt that I had struggled a lot with during undergrad. There was so much out there that it seemed overwhelming to even begin, and famous books like "Cracking the Coding Interview" had all of their interview problems posted in Java, not C++. Of course, there's no denying that the easiest way to improve at something is to practice it a lot. My hope is that the information provided here makes it easier for aspiring CS students to practice, secure awesome internships and jobs for themselves. The repository is meant to serve as quick reference for people to find explanations for coding problems they encounter, or quickly review questions that they have solved long ago.
It stores solutions to problems posted on Leetcode.com, with explanations, some tests to consider, and small gotchas to be aware of. All of these questions have been done in C++ where possible, to provide a foundation for newer UCLA students that are still taking CS 31, CS 32, and CS 33. Of course, even if you are more experienced, from another school, or out of school entirely you are welcome to check out these C++ solutions!
As of the creation of this document there are 39 Easy, 30 Medium, and 6 Hards for a total of 75 questions to practice, hopefully catering to students of all experience levels.
All solution files can be found in the Questions/Question subfolder.
Navigation is intended to be as straightforward as possible, both to make things easy to find and make it easier for me to add new solutions. Every question is marked by the number assigned to it on leetcode.com, with most relevant information contained inside the .cpp files.
Example: 202 - happyNumber.cpp corresponds to Problem 202. on Leetcode, of the same name.
Each .cpp file, in addition to the solution to the problem, contains a comment header with:
* Difficulty of the problem
* Link to the problem on leetcode.com
* Solution in words, with the intuition and explanation
* Most will also consider time and space complexity
* Comments of structures provided for the problem, implemented in the .h files and provided by default by Leetcode when completing the problem
Good luck getting those job offers!! :)
James Wang - You can contact me at jameswang97 at ucla.edu (formatted to prevent spambots).