Leetcode problem enumerator

Enumerates leetcode problems in company problem sets

  1. // ==UserScript==
  2. // @name Leetcode problem enumerator
  3. // @namespace http://tampermonkey.net/
  4. // @version 1
  5. // @description Enumerates leetcode problems in company problem sets
  6. // @author Someone
  7. // @match https://leetcode.com/company/*
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=leetcode.com
  9. // @grant none
  10. // @license MIT
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15. // Your code here...
  16. setInterval(function() {
  17. let questions = document.getElementsByClassName('ellipsis line-clamp-1')
  18. for(let i = 0; i < questions.length; ++i){
  19. let expected = `[Q${i+1}] `
  20. if(questions[i].innerText[0] !== '['){
  21. questions[i].innerText = expected + questions[i].innerText
  22. } else if(!(questions[i].innerText.startsWith(expected))) {
  23. questions[i].innerText = questions[i].innerText.replace(/\[[^\]]+\]/, expected);
  24. }
  25. }
  26. }, 1000);
  27. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址