leetcode小助手

leetcode 热题100随机挑选

이 스크립트를 설치하려면 Tampermonkey, Greasemonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

You will need to install an extension such as Tampermonkey to install this script.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Userscripts와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 유저 스크립트 관리자 확장 프로그램이 필요합니다.

(이미 유저 스크립트 관리자가 설치되어 있습니다. 설치를 진행합니다!)

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

(이미 유저 스타일 관리자가 설치되어 있습니다. 설치를 진행합니다!)

// ==UserScript==
// @name        leetcode小助手
// @description leetcode 热题100随机挑选
// @namespace   qiuguangyi123.leetcode-random-hot
// @version     0.0.1
// @author      qiuguangyi123
// @homepage    https://github.com/qiuguangyi123/tampermonkey-scripts
// @supportURL  https://github.com/qiuguangyi123/tampermonkey-scripts/issues
// @license     MIT
// @match       *://leetcode.cn/*
// @grant       none
// ==/UserScript==
!function() {
  "use strict";
  function e(e) {
    var t, n = (t = 'div[class="truncate"]', document.querySelectorAll(t));
    if (!(n.length <= 0)) {
      clearInterval(e);
      var r = function(e, t) {
        var n = Array.from(e);
        return new Array(t).fill(0).map((function() {
          var e = Math.floor(Math.random() * n.length), t = n[e];
          return n.splice(e, 1), t;
        }));
      }(n, 5);
      return r.map((function(e) {
        return e.innerText;
      }));
    }
  }
  !function(e, t) {
    void 0 === t && (t = {});
    var n = t.insertAt;
    if (e && "undefined" != typeof document) {
      var r = document.head || document.getElementsByTagName("head")[0], o = document.createElement("style");
      o.type = "text/css", "top" === n && r.firstChild ? r.insertBefore(o, r.firstChild) : r.appendChild(o), 
      o.styleSheet ? o.styleSheet.cssText = e : o.appendChild(document.createTextNode(e));
    }
  }(""), window.onload = function() {
    var t = setInterval((function() {
      console.log(e(t));
    }), 300);
  };
}();