add 01
commit
b4f2003833
|
@ -0,0 +1,26 @@
|
|||
param(
|
||||
[parameter(mandatory=$true)]
|
||||
$path
|
||||
)
|
||||
|
||||
$nums = gc $path | % { [int]$_ }
|
||||
|
||||
echo "First question:"
|
||||
$last = $nums[0]
|
||||
$nums[1..($nums.count)] | % {
|
||||
if ($last -lt $_) {
|
||||
$_
|
||||
}
|
||||
$last = $_
|
||||
} | measure-object | % Count
|
||||
|
||||
echo "Second question:"
|
||||
|
||||
$last = $nums[0] + $nums[1] + $nums[2]
|
||||
1..($nums.count-3) | % {
|
||||
$x = $nums[$_] + $nums[$_+1] + $nums[$_+2]
|
||||
if ($last -lt $x) {
|
||||
$x
|
||||
}
|
||||
$last = $x
|
||||
} | measure-object | % count
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,10 @@
|
|||
199
|
||||
200
|
||||
208
|
||||
210
|
||||
200
|
||||
207
|
||||
240
|
||||
269
|
||||
260
|
||||
263
|
Loading…
Reference in New Issue