3

A Chrome Extension to Code Daily with LeetCode

 2 years ago
source link: https://hackernoon.com/a-chrome-extension-to-code-daily-with-leetcode
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
Ashish Kumar

Coder by Day, learning to code at night

I built a Chrome extension based on LeetCode to motivate you to solve a daily coding problem. You can either solve a preselected question or choose from any topic and difficulty of your choice.

How did I build it?

Recently, I decided to code a problem daily for 100 continuous days, without a single day off. While I'm writing this article, I have already reached my 50th day. To keep track of my progress, I decided to tweet the details of the questions/problems that I solved daily. You can view my tweets on Twitter.

https://twitter.com/meashishkmr

Every day, I used to go to LeetCode and select a problem to solve, then I had an idea. Why not develop a chrome extension? The chrome extension will select a problem randomly based on the topic and the difficulty set by me or randomly suggest me every day.

One of the main hurdles during the development process was that LeetCode doesn't have any API docs nor do they mention anywhere how to use them.

Out of curiosity, I first opened the Network tab on the console and look at all the endpoints that The LeetCode page call and after some research, found that they use GraphQL under the hood and their API's are open. Did some reverse engineering and constructed the API endpoints myself, it was fun as well as interesting

LeetCode endpoint on postman to get all the questions for a topic(e.g Array)

LeetCode endpoint on postman to get all the questions for a topic(e.g Array)

I'm glad that I picked this project, learned a lot from it. You can find the source code of the extension on my GitHub.

Source code for the extension

https://github.com/Ashi-s/leetcode-chrome-extension

Thanks for reading this article, If you have a suggestion that would make this chrome extension better, feel free to open a PR or you can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

Happy Coding!!!


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK