In the question CodeChef: Practical coding for everyone
for n=7, I referred to accepted solution and checked for the answer and correct answer was 8 however from my side answer should be 7 by this way:
our initial array K looks like: K=[1,2,3,4,5,6,7]
Optimal steps are: [1,2,3,4,5,6,7]->
[1,2,3,4,5,42,42]->
[1,2,3,20,20,42,42]->
[1,2,3,420,20,420,42]->
[1,2,3,420,420,420,420]->
[420,2,3,420,420,420,420]->
[420,420,3,420,420,210,42]->
[420,420,420,420,420,420,420]
if we follow this way we can get answer smaller than 8 i.e 7
@admin, @dj_r_1 can you please look into this.