Ligeramente superior
Los dos arreglos tienen la misma longitud y son idénticos o difieren en una posición. Devuelve true solo cuando el valor del primer arreglo es mayor en esa posición diferente. Devuelve false cuando los arreglos son idénticos.
Ejemplos
is_first_superior([1, 2, 4], [1, 2, 3]) ➞ true
# The pair of items at each index are compared in turn.
# 1 from the first array is the same as 1 from the second array.
# 2 is the same as 2.
# However, 4 is greater than 3, so array one is superior.
is_first_superior(["a", "d", "c"], ["a", "b", "c"]) ➞ true
is_first_superior(["zebra", "ostrich", "whale"], ["ant", "ostrich", "whale"]) ➞ true
is_first_superior([1, 2, 3, 4], [1, 2, 4, 4]) ➞ false
is_first_superior([true, 10, "zebra"], [true, 10, "zebra"]) ➞ falseNotas
- Ambos arreglos tendrán la misma longitud.
- Todos los valores y sus correspondientes siempre serán del mismo tipo de dato.
- Si los dos arreglos son iguales, devuelve
false.