Mar-29-2022, 12:40 PM
Hello Community folks,
Hope you all are doing well.
So had been practising a few Python programs on Arrays. Need help understanding this very problem, it would really mean alot if someone could comment across each code line on this snippet URL: https://www.interviewbit.com/snippet/549...e98905382/
Problem Statement:
Q) Write a function rotate(arr[], d, n) that rotates arr[] of size n by d elements.
Input : arr[] = [1, 2, 3, 4, 5, 6, 7] d = 2
Output : arr[] = [3, 4, 5, 6, 7, 1, 2]
TIA..!
Hope you all are doing well.
So had been practising a few Python programs on Arrays. Need help understanding this very problem, it would really mean alot if someone could comment across each code line on this snippet URL: https://www.interviewbit.com/snippet/549...e98905382/
Problem Statement:
Q) Write a function rotate(arr[], d, n) that rotates arr[] of size n by d elements.
Input : arr[] = [1, 2, 3, 4, 5, 6, 7] d = 2
Output : arr[] = [3, 4, 5, 6, 7, 1, 2]
TIA..!