Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2
Means you got your answer... Ok
14th Nov 2019, 7:47 PM
Jayakrishna 🇮🇳
+ 2
I think its possible with that 2 options as i specified in above post. In case if he not allowed to take 2nd array, then 2nd option is better.
14th Nov 2019, 9:18 PM
Jayakrishna 🇮🇳
+ 2
demo right shift dinamic array with grow https://code.sololearn.com/cxPU1NCP2bVX/?ref=app
15th Nov 2019, 10:49 PM
Michail Getmanskiy
Michail Getmanskiy - avatar
+ 1
Take two arrays, Copy i th value to i+1 th value... Then copy back if you need... 2nd : swap from last 2 elements nth to n-1th, then repeat upto 1st 2 elements, and set first element to 0.
14th Nov 2019, 5:54 PM
Jayakrishna 🇮🇳
+ 1
NoobTech2.0 Do you need to retain first value..?
14th Nov 2019, 7:00 PM
Jayakrishna 🇮🇳
+ 1
👍
14th Nov 2019, 10:15 PM
Jayakrishna 🇮🇳
0
So did you get it?
14th Nov 2019, 7:05 PM
Jayakrishna 🇮🇳