• + 1 comment

    is that example wrong or I 'm not understanding the problem correctly? the rotation of [5,4,3] can not be performed directly according to problem description, right? 4,3,5 then 3,5,4

    A		rotate 
    [1,6,5,2,4,3]	[6,5,2]
    [1,5,2,6,4,3]	[5,2,6]
    [1,2,6,5,4,3]	[5,4,3]
    [1,2,6,3,5,4]	[6,3,5]
    [1,2,3,5,6,4]	[5,6,4]
    [1,2,3,4,5,6]
    
    YES