DEV Community

TK
TK

Posted on

1 1

Remove Leetcode locked problems

If you're solving some Leetcode problems, but don't want to subscribe to the membership, you can use a simple script to remove all locked problems from your current list.

The locked problems are only for subscribers, so you can't access it. They are there as a call to action to subscribe.

const lockedProblems = document.querySelectorAll('[data-original-title="Subscribe to unlock"]');

lockedProblems.forEach(problem => {
  problem.parentElement.parentElement.parentElement.parentElement.remove();
});
Enter fullscreen mode Exit fullscreen mode

Use this simple script to get rid off all the locked problems. Now it is clean and help you focus on the problems you can access.

You can also find this script in the Remove Leetcode locked problems gist.

If you are solving problems, you may be interested in my Algorithms Problem Solving series.

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay