Sha256: a2c67ce59bc4b2e5f049ed876d8cc47915accdbad192915a507d311cc3940010
Contents?: true
Size: 572 Bytes
Versions: 54
Compression:
Stored size: 572 Bytes
Contents
function sort(input: string): string { return input.toString().toLowerCase().split("").sort().join("") } class Anagram { value: string constructor(input: string) { this.value = input } matches(...input: string[]): string[] { const result: string[] = [] for (const each of input) { if (sort(each) === sort(this.value)) { if (each.toLowerCase() === this.value.toLowerCase()) { continue } result.push(each) } } return result } } export default Anagram
Version data entries
54 entries across 54 versions & 1 rubygems