jesus this time i finally beat 78% person on complexity. but memory only beat 33% person although it's o(1).in the solution i was reminded a way to get max one from two numbers. that's
max(number1, number2)
another difference in my solution, i compare max length and consecutive length when item changes to 0 and at the end, but he compares every time consecutive length add 1. the code is neat but it compares when it actually does not need.
Top comments (0)