Inspiration

We wanted to create a Discord bot that would help CS students practice their LeetCoding skills in an easy, accessible manner. We were inspired by our own struggles as CS majors with LeetCode, as we often felt lost when it came to starting LeetCode problems. This makes the website accessing the contents of the website simpler for students.

What it does

LeetBot generates random LeetCode problems selected from the actual list of examples on the LeetCode website. When prompted by !leet, the bot will ask what level of difficulty the user wants to attempt. When the user returns the commands: !leeteasy, !leetmedium, or !leethard, the bot will then return a randomly selected problem from the desired level of difficulty.

How we built it

We imported several libraries to help us access Discord commands and acquire LeetCode problems from the website. Utilizing Python, public API, and user-inputted commands, our program responds to user commands: whether it's !leet or the level of difficulty itself. Using a random generator function, the program will select a random problem and return it and a link to problem on the website to the user.

Challenges we ran into

We initially used JavaScript, but there was no LeetCode API available for public use. Our next choice of language was Python, but we had to scrap our previous project entirely and restart. Then, we faced difficulties trying to configure permissions for the bot, so that it would be able to respond in the server.

Accomplishments that we're proud of

We are proud of learning how Discord bot intents and privileges work, since we were set back by that particular issue for a good portion of the Hackathon. We're also proud of learning how to code in Python in approximately 24 hours, since we only had limited experience with a couple languages (not including Python).

What we learned

We learned Python, import statements, team collaboration for a unified goal, resilience, and efficiency in the creation of an easy-to-use, functional program.

What's next for LeetBot

We want to expand LeetBot by creating tags to specify what type of problem the user wants, in addition to levels of difficulty. This would include tags like "arrays" or "dynamic programming" or "doubly linked lists," which would return more specific problems that the user wants.

Built With

Share this project:

Updates