Algorithms and Data Structures — Solutions for the problems on LeetCode and HackerRank

Jeffrey Chen
2 min readAug 1, 2021

--

Many companies would like to ask interviewees Algorithms and Data Structures problems to check the programming skills in the interview. LeetCode and HackRank are the two of the most popular website providing those kinds of problems for you to practice.

Algorithms and Data Structure are the basics of programming, so even you are not preparing for the interview, it’s still good to practice the problems to level up your programming skills. I have used Leetcode for two years and I am aware recently that I have finished more than 500 problems already. So, I would like to summarize and share those solutions.

I have created a GitHub project leetcode-solutions to collect those solutions I implemented before. The project just started, I will keep sorting out the code and adding it to the project. I will list down the problems which already been covered in the ReadMe.

For each solution, I will attach the time complexity, space complexity, and leetcode link at the beginning of the file.

Also, I will add some comments for some tricky parts of the code.

At the same time, I started to take new challenges on HackerRank last month. So, I am also collecting my solutions to another GitHub project hackerrank-solutions. I will keep updating the project when I finish now problems.

Although the solutions have passed the test cases provided in the problem, it may not always be the optimized solution. So, if you find any issues or you have any questions when you browse the code, please feel free to let me know.

--

--

Jeffrey Chen

Software engineer who’s dream is to become an athletes