Optimizing an "almost-increasing" array problem

Thanks to you and @cmo for your responses. There are a few test cases that defeat @Eiji’s solution (it incorrectly returns true when given [1,2,1,2]) but it uses tail recursion, which is the right way to go, I think. Here’s what I wound up with:

def solution(sequence) do
    solution(sequence, length(sequence))
end

def solution(sequence, count) when count <= 0 do
    is_ascending?(List.delete_at(sequence, count))
end

def solution(sequence, count) do
   is_ascending?(List.delete_at(sequence, count)) or solution(sequence, count - 1)
end

def is_ascending?([_]),        do: true
def is_ascending?([a,b|tail]), do: b > a and is_ascending?([b|tail])

I think that, in cases where you’re dealing with very long lists, the Enum module is gonna be too slow much of the time because it always enumerates over the whole list. In cases like that, you want tail recursion instead.