I implement a bucketsort algorithm in python, but I got an erroroutput([1, 0]) for the input [0, 1], I am pretty sure that my code is correct because it works well in my computer, so does someone know how to get rid of it?
Did someone pass this in Python?

I got similar problem that could not pass the test case [1, 0] while my code worked well on my computer, it's weird :(
class Solution: # @param A a list of integers # @return nothing, sort in place def sortColors(self, A): if A != None and len(A) > 1: A, one, two = self._sort(A) # one is the place to insert 1, two is the place to insert 2 def _sort(self, A): if len(A) == 1: if A[0] == 0: return A, 1, 1 if A[0] == 1: return A, 0, 1 if A[0] == 2: return A, 0, 0 tmp = A[1] A, one, two = self._sort(A[:1]) if tmp == 0: A.insert(0, tmp) return A, one+1, two+1 if tmp == 1: A.insert(one,tmp) return A, one, two+1 if tmp == 2: A.insert(two,tmp) return A, one, two