We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Hi
Not sure who may look
It looks like test expected output is wrong for several input test cases
(I manually calculated periods for some and never got as expected output)
Moreover, then I looked at Editorial section and seems there is an error
That code gives 17 count for input: 7, {3, 1, 2, 5, 4, 6, 7}
Will not be there only 13: {3}, {1}, {1, 2}, {1, 2, 5}, {2}, {2, 5}, {5}, {4}, {4, 6}, {4, 6, 7}, {6}, {6, 7}, {7}?
Almost sorted interval
You are viewing a single comment's thread. Return to all comments →
Hi Not sure who may look It looks like test expected output is wrong for several input test cases (I manually calculated periods for some and never got as expected output)
Moreover, then I looked at Editorial section and seems there is an error That code gives 17 count for input: 7, {3, 1, 2, 5, 4, 6, 7} Will not be there only 13: {3}, {1}, {1, 2}, {1, 2, 5}, {2}, {2, 5}, {5}, {4}, {4, 6}, {4, 6, 7}, {6}, {6, 7}, {7}?