parent
215c6c6f93
commit
81def1e8f8
3 changed files with 19 additions and 2 deletions
@ -1,2 +1,6 @@ |
|||||||
|
* |
||||||
|
!*.* |
||||||
|
!*/ |
||||||
|
|
||||||
*.swp |
*.swp |
||||||
*.swo |
*.swo |
||||||
|
@ -0,0 +1,15 @@ |
|||||||
|
import Foundation |
||||||
|
|
||||||
|
let contents = try! String(contentsOfFile: "input.txt") |
||||||
|
var lines = [Int]() |
||||||
|
for l in contents.split(separator:"\n") { |
||||||
|
lines.append(Int(l)!) |
||||||
|
} |
||||||
|
|
||||||
|
var increases = 0 |
||||||
|
for i in 1..<lines.count { |
||||||
|
if lines[i] > lines[i-1] { |
||||||
|
increases += 1 |
||||||
|
} |
||||||
|
} |
||||||
|
print(increases) |
Loading…
Reference in new issue