99x Interview Question

How can you reverse the elements of the given string array?

Interview Answers

Anonymous

Jun 2, 2018

if(strArr.length == 0){ System.out.println("The array is empty"); } else { for(int i = strArr.length-1; i>=0; i--){ System.out.print(strArr[i] +", "); } } I believe this is the answer to the question. If I am wrong please corrent me

Anonymous

Oct 21, 2019

we can do return (arr[::-1]) in Python. Is it okay to answer this using Python?