For now try the tester’s solution given under tab. There are some messups with solution link by @admin this time.
Thats just an implementation step. If I subtract ‘0’ from ‘1’ , I get (49-48) [their ASCII values!!] =1 which I can use as an index in array.
Which line made you think that you HAVE to fill ONLY that way? I might help there! You can fill anyway if I recall correctly- there are multiple valid ways out of which any can be chosen.
actually, I am not able to understand this part.
Could please provide comments over filling of the table for row 1.
Else if (A1,j−1==L) then Aij=W//I can force my opponent to lose by moving to cell (1,j−1) Else A1j=L``` Here, if A[j]=='W' then why A[i][j]='W'??
Assume 1 based indexing, where A[j] represents the j’th character in string (just like shown in pciture, string character above column). If ending up on that cell is W, then I will just move my cell to that and win. Dont assume Row 1 corresponds to 0’th index in array. 0’th index is for string.
@vijju123 could you provide your solution for this problem as above links are not working.
There wasnt any editorialist solution, idk which solution he linked lol. You can refer to @um_nik 's code for now - its based on editorial except that it calculates for first 10 rows. I will try to upload my solution by evening.
Can I somehow get test data for past problems, that my solution failed? It is often very helpful for debugging. For any problem, not for this one.