Commit 5ab6a38
committed
feat: Rotate array left by one position and print before and after
🧠 Logic:
- Define an array of integers.
- Print the original array using a helper method.
- Rotate the array left by one:
- Store the first element temporarily.
- Shift all other elements one position to the left.
- Place the first element at the end of the array.
- Print the rotated array to observe the change.
Signed-off-by: Somesh diwan <[email protected]>1 parent c6280f3 commit 5ab6a38
1 file changed
+2
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
| 13 | + | |
15 | 14 | | |
16 | 15 | | |
17 | 16 | | |
| |||
20 | 19 | | |
21 | 20 | | |
22 | 21 | | |
23 | | - | |
| 22 | + | |
0 commit comments