Skip to content

Instantly share code, notes, and snippets.

@panwarab
Created July 1, 2019 17:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save panwarab/bde99734e0e97318dbabd984a5cd90ac to your computer and use it in GitHub Desktop.
Save panwarab/bde99734e0e97318dbabd984a5cd90ac to your computer and use it in GitHub Desktop.
Leetcode - per page performance calculator
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