Skip to content

Instantly share code, notes, and snippets.

@mohanmca
Last active October 3, 2021 12:13
Show Gist options
  • Save mohanmca/46b8c022932ec3bc10eb08742dee0bf6 to your computer and use it in GitHub Desktop.
Save mohanmca/46b8c022932ec3bc10eb08742dee0bf6 to your computer and use it in GitHub Desktop.
Analyze question frequency based on company

Steps to find tag frequency of problems set for a company

  1. Goto page that has problem for a company - https://leetcode.com/company/goldman-sachs/
  2. Select check box "Show problem tags"
  3. "Open console of the browser - F12"
  4. Paste below javascript
  let tags = Array.from(document.getElementsByClassName('tags-cell__I1pn'))
  let table = tags.map( e => Array.from(e.children).map(e1=>e1.innerText)).reduce((a,b) => a.concat(b),[]).sort().reduce((r,c) => (r[c] = (r[c] || 0) +1, r), {})
  // console.table(table)
  let sorted = Object.entries(table).sort( (a,b) => b[1] - a[1]).map( a => [a[1], a[0]])
  let rating = Object.fromEntries( sorted  )
  console.table(rating)
  JSON.stringify(rating, 2, null)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment