79100341

Date: 2024-10-18 02:32:48
Score: 0.5
Natty:
Report link

We can do this:

def rindex(array, value) -> int:
    i = array[::-1].index(value)
    return len(array) - i - 1

That will not revert array in memory address, then it avoids two array.reverse() calls.

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Mateus Alves de Oliveira