langs a-z
This commit is contained in:
parent
db842d013d
commit
d066446780
11389 changed files with 98361 additions and 1020 deletions
13
Task/Anagrams/PowerShell/anagrams.psh
Normal file
13
Task/Anagrams/PowerShell/anagrams.psh
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
$c = New-Object Net.WebClient
|
||||
$words = -split ($c.DownloadString('http://www.puzzlers.org/pub/wordlists/unixdict.txt'))
|
||||
$top_anagrams = $words `
|
||||
| ForEach-Object {
|
||||
$_ | Add-Member -PassThru NoteProperty Characters `
|
||||
(-join (([char[]] $_) | Sort-Object))
|
||||
} `
|
||||
| Group-Object Characters `
|
||||
| Group-Object Count `
|
||||
| Sort-Object Count `
|
||||
| Select-Object -First 1
|
||||
|
||||
$top_anagrams.Group | ForEach-Object { $_.Group -join ', ' }
|
||||
Loading…
Add table
Add a link
Reference in a new issue