RosettaCodeData/Task/Longest-string-challenge/PowerShell/longest-string-challenge-2.psh

13 lines
223 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
@'
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