Test cases
|
|
Solution 1: accepted 3ms 81%
The performance is good, but the style is a diseaster man.
Time: O(n)
Space: O(n)
|
|
Solution 2: accepted 6ms
Looks better, but worse performance than solution 1.
|
|
Further improvement: 4ms
|
|
|
|
The performance is good, but the style is a diseaster man.
Time: O(n)
Space: O(n)
|
|
Looks better, but worse performance than solution 1.
|
|
|
|