+ 1
Can any one help me to understand this problem?
Explain 2&3 test cases if the output traced is like as they given... I'm not getting output as they given If you got the output as they given explain https://www.sololearn.com/post/273372/?ref=app
4 odpowiedzi
+ 2
No, the given outputs are correct.
Read again.
"""
In addition, Chef should never perform multiple consecutive moves along the same axis of the grid. If there are multiple consecutive instructions to move along the same axis (left/right or up/down), he should perform only the first of these
"""
In case 2: 'LLLRUUD'
in Substring 'LLLR' and 'UUD', we are moving along the same axis, so, only first of their moves will be executed.
Equivalently :
LLLRUUD = LU
And LU = (0,0) --> (-1,0) --> (-1,1)
You can think for case 3 in similar way.
+ 1
Sudden Lee wow you are right, I had not noticed that. Thanks 👌👍
+ 1
Sudden Lee thanks 👍💐
0
you are right is strange, because the second case LLLRUUD should give (0,0)
Because begins 0,0 L-1,0 L-1,0 L-1,0 here is R so 0,0 U0,1 U0,1 and next D so 0,0