[Leetcode] Gadget, statistic number, hidden locked topic

Source: Internet
Author: User

Leetcode problems list does not have the statistic quantity function, has written one conveniently.

The following two paragraphs just use jquery to adjust what's displayed on the page, and it's useless to refresh the page.

For example, to see how many easy, medium and hard topics There are, run the following code in the browser console.

There is also a usage, for example, see how many did not do, or did not do the question how many easy, medium and hard, first select the unsolved problems filter, and then run the code with the console.

1 //Count Problems2 varList = $ ("tbody > TR"). Not (". Hide")), tdlist, HTML;3Console.log ("---Count problems:" +list.length);4 varCounteasy = 0, Countmedium = 0, Counthard = 0;5  for(vari = 0; i < list.length; i++){6Tdlist = $ (list[i]). FIND ("TD");7HTML = $ (tdlist[tdlist.length-1]). HTML (). toUpperCase ();8     if(html = = = "Easy"){ 9counteasy++;Ten}Else if(html = = = "MEDIUM")){ Onecountmedium++; A}Else if(html = = = "Hard"){ -counthard++; -     }   the } -Console.log ("---Count easy:" +counteasy); -Console.log ("---Count Medium:" +countmedium);  -Console.log ("---Count hard:" + counthard);

The following paragraph hides all locked topics:

1 //Hide Locked problems2 varList = $ ("Tbody > TR");3  for(vari = 0; i < list.length; i++){4     if($ (List[i]). FIND ("td > I.fa-lock"). Length > 0){5$ (List[i]). addclass ("Hide");6         //List[i].remove ();7     }8}

[Leetcode] Gadget, statistic number, hidden locked topic

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.