Skip to content

Latest commit

 

History

History
40 lines (31 loc) · 1.34 KB

File metadata and controls

40 lines (31 loc) · 1.34 KB

How to remove leetcode premium problems from your problem list

For PROs

var x = document.getElementsByTagName("tr");
var sum = x.length;
for (let i = 0; i < x.length; i++) {
    if (x[i]["cells"][2]) {
        if (x[i]["cells"][2].firstElementChild.getElementsByTagName("span")[1]) {
            if (x[i]["cells"][2].firstElementChild.getElementsByTagName("span")[1].attributes[3].value === "Subscribe to unlock") {
                x[i].hidden=true
                sum--
            }
        }
    }
}
console.log(sum)

For newbees, step by step

before

  • Press F12 to open browser dev tools -> Console

use code

  • Ctrl+C the javascript code above and Ctrl+V to the console then press Enter
  • Check the result, all the locked/premium problems disappeared

    Tip: those premium problems will show up again if you refresh the page, so you'd better Open link in a new TAB.

after