RosettaCodeData/Task/Longest-string-challenge/PowerShell/longest-string-challenge-2.ps1
2026-04-30 12:34:36 -04:00

12 lines
223 B
PowerShell

@'
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