RRSTONE why stone?

Does the problem name stone has something to do with the problem logic? Instead of trying in all possible way i am getting error “Wron Answer”.
Also, the line “Then Ai = MAX - Ai is done for every 1 <= i <= N.” Why value of i from 1 instead of 0?

1 Like

‘i’ is not index of array

there is nothing to do with term stone in problem. The line Ai=MAX-Ai… we have N elements in array. 1 … N =1+1+1+…up to N=N. If you start from i=0 then up to N-1 would equal to N elements…this is way in which you store elements in array.the fact is you must store N elements and proceed it. you can also start from

i=2, 2…N+1;

i=3, 3…N+2;

1 Like

@antim_patel Dont diccuss the logic of question please here you are violating the rules… :frowning:

it’s the matter of setter’s choice if indexing is 0-based or 1-based and it’s clear from problem statement which one is used… 0-based is for example in C-like languages, 1-based is in Pascal, PL/SQL and so on…