"Can a given array be made strictly increasing by removing one number?"
I'm not completely sure I've interpreted the requirements correctly, but I think this should do it:

def almost_increasing_array?(array, tolerance)
  unmatched = 0
  array[1..-1].each_with_index do |item, index|
    unmatched += 1 if array[index] &gt;= item
    return false if unmatched &gt; tolerance
  end
  true
end


The tolerance is extra but it basically says this:


Ignore the first item in the array
For the rest, compare them to the previous item
If the previous item was more than this, increment 'unmatched' count.
If more than the tolerance didn't increase, false. It's not 'almost increasing'


It looks like it works for all cases.

almost_increasing_array?([1, 3, 5], 1) # true
almost_increasing_array?([5, 4, 3, 2, 1], 1) # false
almost_increasing_array?([1, 2, 5, 4], 1) # true (only one decrease)
almost_increasing_array?([1, 7, 5, 4], 1) # false (two decreases)
almost_increasing_array?([1, 7, 5, 4], 2) # true (two decreases, but we said that's okay)


You could easily simplify by removing the tolerance argument (hard coding 1).

def almost_increasing_array?(array)
  unmatched = 0
  array[1..-1].each_with_index do |item, index|
    unmatched += 1 if array[index] &gt;= item
    return false if unmatched &gt; 1
  end
  true
end


Weaknesses:


This includes an array which is fully increasing, too.
This will fail as soon as an issue is found, but it may run slowly on huge arrays where there's a decrease right at the end.


Strengths:


It's pretty simple to understand.
This doesn't even have to be an array, it'll work for an instance of any Ennumerable class. Such as ActiveRecord::Relation, or Hash.