We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dado un array de enteros, ordenado en forma creciente, encontrar la posición inicial y final de un valor dado.
array
Si el valor no se encuentra en el array, retornar [-1, -1].
[-1, -1]
Se debe escribir un algoritmo que tenga una complejidad en tiempo de ejecución de O(log n)
O(log n)
Ejemplo 1:
Input: nums = [5,7,7,8,8,10], target = 8 Output: [3,4]
Ejemplo 2:
Input: nums = [5,7,7,8,8,10], target = 6 Output: [-1,-1]
Ejemplo 3:
Input: nums = [], target = 0 Output: [-1,-1]
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Dado un
array
de enteros, ordenado en forma creciente, encontrar la posición inicial y final de un valor dado.Si el valor no se encuentra en el
array
, retornar[-1, -1]
.Se debe escribir un algoritmo que tenga una complejidad en tiempo de ejecución de
O(log n)
Ejemplo 1:
Ejemplo 2:
Ejemplo 3:
The text was updated successfully, but these errors were encountered: