PJdan's blog

By PJdan, history, 2 years ago, In English

Without Leetcode Premium, it's annoying to have to see those locked problems.

Here is a user script used to hide locked problems in Leetcode.

  1. Install Tampermonkey
  2. Create a new script:
// ==UserScript==
// @name         Hide locked Leetcode problems
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Hides locked Leetcode problems
// @author       PJDan
// @match        https://leetcode.com/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=leetcode.com
// @grant        none
// ==/UserScript==

$(document).ready(function() {
    setTimeout(hide, 3000);

    function hide() {
        document.querySelector('.reactable-th-frequency').remove();
        document.querySelectorAll('.frequency-locked').forEach(e => e.remove());
        var lockItems = $(".fa-lock");
        lockItems.closest('tr').hide();
    }
});

Make sure the script is enabled

  • Vote: I like it
  • +15
  • Vote: I do not like it