Implement the leftRotateArrayByOne method that returns the array after rotating all elements one position to the left.
The input contains an integer array nums and its length size. Your task is to rotate the array one position to the left and return the updated array.
In a left rotation, the first element moves to the end and every other element shifts one position toward the front. For example, [1,2,3,4] becomes [2,3,4,1].
Handle arrays of size 0 or 1 directly because rotation will not change them.
For larger arrays, store the first element, shift every remaining value one position left, then place the stored first element at the last position.
Pseudocode:
function leftRotateArrayByOne(nums, size):
if size <= 1:
return nums
first = nums[0]
for i from 0 to size - 2:
nums[i] = nums[i + 1]
nums[size - 1] = first
return nums