export class Anagram { input : string; constructor(input: string) { this.input = input.toLowerCase(); } public matches(...potentials: string[]): string[] { let res: string[] = []; let sortedStringFirst: string = this.input.split('').sort().join(''); for(let potential of potentials){ let toLow = potential.toLowerCase(); let sortedString: string = toLow.split('').sort().join(''); if(this.input != toLow && sortedString == sortedStringFirst && this.input.length == potential.length) res.push(potential); } return res; } }
Anagram
3 months ago in #ita by drago18121996 (72)
$0.06
- Past Payouts $0.06
- - Author $0.03
- - Curators $0.03
18 votes
- gianluccio: $0.04
- garlet: $0.01
- slider2990: $0.01
- drago18121996: $0.00
- stem.alfa: $0.00
- dorkpower: $0.00
- marcolino76: $0.00
- garlet-68: $0.00
- babytarazkp: $0.00
- meestemboom: $0.00
- spiceboyz: $0.00
- holovision.stem: $0.00
- lorenzopistolesi: $0.00
- saboin.stem: $0.00
- sillybilly: $0.00
- juecoree.stem: $0.00
- abh12345.stem: $0.00
- joeyarnoldvn: $0.00