Shifting of elements

i don’t understand how to shift j to end of array and then after replacing shift all j’s to right to left.
also pls tell me how to insert values int b/w array!!!

could u share code
or
draw on pen paper as to what u want to ask
from where j starts??

u cannot insert in b/w u can just replace values

in the que replace all pi :
when we get a[I]==‘p’ and a[I+1]==‘i’

in the que replace all pi :
when we get a[I]==‘p’ and a[I+1]==‘i’
now the next steps of shifting the elements so that we put 3.14 and then reshift all elements back !!
so tell me how shifting take place

doing it in place will lead to a lot of problem we can simple take an additional string we when we encounter the condition when a[l] == ‘p’ and a[l+1] = ‘i’ then we can add 3.14 to the string else simple place the present character in string

if we try doing the shifiting we will surely end makinf mistake