my first submission take 135ms beat 5% people, that's terrible, the complexity is n^2. i cancel the deep copy, not using new list, using while loop and compare the adjacent elements, it still takes 63ms, beats 10% people. i ask chatgpt, the complexity is still n^2 since list pop complexity is n^2.i should ask chatgpt firstly than i know how to improve, but i checked the solutions firstly.
i use pointer to resolve the problem, it consumed 0ms! now i know why pointer is terrible.
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (0)