Skip to content

intmainreturn00/LeetHack

Repository files navigation

LeetHack

Bot that solves LeetCode and HackerRank for you.

This bot will go through all unsolved, non-premium, non-contest tasks from a given URL. For each task it will query open ai for a solution, paste it into the code editor and press Submit button. Solutions are also saved into solutions.md with comments for further study.

Note: Use at your own risk.

YouTube|350

Installation

You'll need Node.js.

npm install

Configuration

Fill in your credentials in config.json:

{
  "OPENAI_API_KEY": "",
  "MODEL": "gpt-4o",
  "MAX_TOKENS": 700,
  "URL": "https://leetcode.com/studyplan/leetcode-75/",
  "LANG": "JavaScript"
}

Run

node bot.js

Log In

The first time you run the bot, LeetCode / HackerRank will ask you to log in.

Log in manually, solve the CAPTCHA if needed, and press Enter in the terminal.

The bot will save your cookies (cookies_leetcode.json and / or cookies_hackerrank.json respectively), so you won’t need to log in again.

coffee ☕️

About

Bot that solves LeetCode and HackerRank for you.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published