Ad

I decided to golf up this kumite - for the sanity of the tester, I trim the function definition to remove leading or trailing spaces.

Code
Diff
  • Write-Verbose (Get-Module pester -listAvailable).Version.ToString()
    function calculate_multiples {
        (1..999|?{!($_%3) -or !($_%5)}|measure -s).sum
    }
    • Write-Verbose (Get-Module pester -listAvailable).Version.ToString()
    • function calculate_multiples {
    • $SUM = 0
    • 1..999 | ForEach-Object {
    • if (!( $_ % 3) -OR !($_ % 5)) {
    • $Sum += $_
    • }
    • }
    • return $Sum
    • (1..999|?{!($_%3) -or !($_%5)}|measure -s).sum
    • }