Skip to content

Instantly share code, notes, and snippets.

View mesterum's full-sized avatar

Mihai Manole mesterum

  • http://www.johnabbott.qc.ca/
  • Piatra Neamț, România
  • 21:45 (UTC +03:00)
  • X @MihaiManole8
View GitHub Profile

Keybase proof

I hereby claim:

  • I am mesterum on github.
  • I am mihaimanole (https://keybase.io/mihaimanole) on keybase.
  • I have a public key ASDHxu9Z4qZpk6-ewRgIF4dQRTH0zhWcQ7o7zqP9xyEZFwo

To claim this, I am signing this object:

@mesterum
mesterum / no-repeats-please.js
Last active May 11, 2020 12:34
freeCodeCamp Algorithm Challenge Guide: No Repeats Please
function permAlone(str) {
if(str=='') return 1
const bag=new Map()
for(const c of str){
bag.set(c,(bag.get(c)||0)+1)
}
const essence=[]
for(let v of bag.values()){
essence[--v]=(essence[v]||0)+1
}