Write a function isIncreasing that takes a list of Ints and returns true if numbers are in increasing (equals OK) order. An empty list should result in true.
func isIncreasing(_ l: [Int]) -> Bool {
var flagreturn=true
if l.count == 0 {
flagreturn=true
} else {
for i: Int in l {
if l[i] < l[i + 1] {
flagreturn=true
}
else{
flagreturn=false
}
}
}
return flagreturn
}
Not sure if I implemented the true and false correctly in the code.