We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Data Structures
- Arrays
- Arrays - DS
- Discussions
Arrays - DS
Arrays - DS
Sort by
recency
|
2091 Discussions
|
Please Login in order to post a comment
C++ solution vector reverseArray(vector a) { reverse(a.begin(),a.end()); return a; }
my code is giving the output 2,3,4,1 on all other online compilers but not on hackerrank
It's my first time here. How can I write "pip install numpy as np" and what exactly needs to be written before the code?:
import numpy as np
lista = [1,4,3,2] meu_array = np.array(lista)
array_invertido = meu_array[::-1]
print(array_invertido)
It's my first time here. How can I write "pip install numpy as np" and what exactly needs to be written before the code?:
import numpy as np
lista = [1,4,3,2] meu_array = np.array(lista)
array_invertido = meu_array[::-1]
print(array_invertido)
const arr1 = [1,4,3,2]; const Arr = []; for(i=arr1.length-1; i>=0; i--){ Arr.push(arr1[i]); } console.log(...Arr);