Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Who can tell me the time complexity of the solution?
Inconceivably!
I konw why that I'm not thinking about the order of zeros!
Can anyone tell me that eror cause?
log: [ 1, 2, 52, 7, '3', 1, 0, 0, '0', '0' ]
Expected: '[1,2,52,7,"3",1,"0",0,"0",0]', instead got: '[1,2,52,7,"3",1,0,0,"0","0"]'
When I run removeZeros([1,2,52,7,"3",1,"0",0,"0",0]) in my IDE it returns [1,2,52,7,"3",1,"0",0,"0",0].
Where did I go wrong?
I'm sorry. How careless of me.
Wrong solution.How about board with -1 and 10 ? just like this(all 1 is replaced by -1 and all 9 is replaced by 10)
[
[5, 3, 4, 6, 7, 8, 10, -1, 2],
[6, 7, 2, -1, 10, 5, 3, 4, 8],
[-1, 10, 8, 3, 4, 2, 5, 6, 7],
[8, 5, 10, 7, 6, -1, 4, 2, 3],
[4, 2, 6, 8, 5, 3, 7, 10, -1],
[7, -1, 3, 10, 2, 4, 8, 5, 6],
[10, 6, -1, 5, 3, 7, 2, 8, 4],
[2, 8, 7, 4, -1, 10, 6, 3, 5],
[3, 4, 5, 2, 8, 6, -1, 7, 10],
]
Wrong Solution, it can't promise every element in row or column to be diff and locate in [1-9]. Use Set
niubility
Stupid but effective
good job
This is the Best Practice!
The time complexity of this is O(26 * n)!