Powershell 3: Cmdlets Hackerrank Solution Extra Quality

$input = [Console]::In.ReadToEnd().Trim() $lines = $input -split "`n" | ForEach-Object $_.Trim() | Where-Object $_ -ne "" $nums = ($lines[1] -split '\s+') | ForEach-Object [int]$_ $result = ($nums | Measure-Object -Sum).Sum Write-Output $result

Better approach:

, looked promising for creating a temporary auditor account, but powershell 3 cmdlets hackerrank solution