Reverse Elements in Array

Asked at Meta · Coding Questions · Difficulty: Easy

Given an integer array `array` and two indices `i` and `j`, reverse the elements between `i` and `j`. Be sure to handle edge cases such as `i` being greater than `j`, `array` being `null`, and `i` and `j` out of boundaries.

Loading the problem…