• + 0 comments

    Looks the question is changed from using {5, 2, 1} to {5, 3, 1}, so we might need to change the number value in above code. Otherwise given input {2, 2, 5, 7}, it will give answer 3, but it could be 2. But the test cases are not updated, so this answer will pass all test cases. One more comment, we just need to concern about base in [0: 4], as if base is 5, there will be definitely one more operation needed.