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)
- login to your leetcode account
- go to the leetcode problems page
- Press
F12
to open browser dev tools ->Console
Ctrl+C
the javascript code above andCtrl+V
to the console then pressEnter
- 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
.