Created
July 1, 2019 17:11
-
-
Save panwarab/bde99734e0e97318dbabd984a5cd90ac to your computer and use it in GitHub Desktop.
Leetcode - per page performance calculator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ppc=function(){ | |
var total_problems=window.document.getElementsByClassName("reactable-data"); | |
var i; | |
var sum=0; | |
var total=total_problems[0].childNodes.length; | |
for (i=0;i<total;i++){ | |
var row=total_problems[0].childNodes[i]; | |
var td=row.childNodes[0]; | |
var attribute=td.getAttribute("value"); | |
if(attribute==="ac"){ | |
sum=sum+1; | |
} | |
} | |
console.log(sum+"/"+total+" :: Solve rate = "+((sum/total)*100)+"%"); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment