Há uma tendência crescente?
Crie uma função que determine se há uma tendência crescente.
Exemplos
upwardTrend(new Object[] {1, 2, 3, 4}) ➞ true
upwardTrend(new Object[] {1, 2, 6, 5, 7, 8}) ➞ false
upwardTrend(new Object[] {1, 2, 3, "4"}) ➞ "Strings not permitted!"
upwardTrend(new Object[] {1, 2, 3, 6, 7}) ➞ trueObservações
- Se houver um elemento do tipo String no array, retorne
"Strings not permitted!". - Os números não precisam ser consecutivos (e.g.
[1, 3, 5]ainda deve retornartrue).