RosettaCodeData/Task/Longest-string-challenge/PowerShell/longest-string-challenge-2.psh
2023-07-01 13:44:08 -04:00

12 lines
223 B
Text

@'
a
bb
ccc
ddd
ee
f
ggg
'@ -split "`r`n" |
Group-Object -Property Length |
Sort-Object -Property Name -Descending |
Select-Object -Property Count, @{Name="Length"; Expression={[int]$_.Name}}, Group -First 1