Imagine that You are begininner java student trying to do this project. Given an array…
- User
Imagine that You are begininner java student trying to do this project. Given an array of integers, shift all elements one place to the left and return the array. The first element should be shifted to the last elements.
Example:
shiftLeft({1, 2, 3, 4, 5}) --> {2, 3, 4, 5, 1} shiftLeft({3, 8, 7}) --> {8, 7, 3}
- Assistant
As a beginner Java student, you might want to approach this problem step by step. Here's a simple way to write a Java method that performs the described operation: