Click here to see the full article post
Even though it is O(n), it is in fact 9n. We can simply solve this problem by two passes.
@longwill8 Hi, could you show your two-pass solution please?
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.