How isn't anyone noticing and upvoting this solution???
seekerwu
@seekerwu
Posts made by seekerwu

RE: Java divide and conquer solution beats 96%

RE: Java Oms with explanation
How do you prove there're only three ways the lines would cross itself?

RE: [Java] Accepted Code: Stack implementation.
How can you push (a/b) onto the stack? Wouldn't this cause rounding problems?

RE: 3 lines Python, with Explanation / Proof
If the time complexity is O(NlogN) we can just sort the array and rearrange it your way (smaller half on odd, larger half on even) right? But I feel like this is not what the question is asking for (O(N) time and O(1) space)
Also, correct me if I'm wrong, but wouldn't your proof require the numbers in lower half and upper half be sorted respectively? For example, here the original example is:
Small half: M . M . S . S
Large half: . L . L . M .Together: M L M L S M S
But if I change this to
Small half: M . M . S . S
Large half: . M . L . L .Together: M M M L S L S
Then it wouldn't satisfy the requirement.

RE: Simple O(N) time, O(1), space Java solution.
NICE! ELEGANT! NICE AND ELEGANT!

RE: Preorder, Inorder, and Postorder Iteratively Summarization
Sorry if I missed your point, but how can a binary tree has topological dependencies?

RE: Share my twoend BFS in C++ 80ms.
What happens if the two input strings are the same? This algo will return 2 but I think the correct solution is 1.

RE: Mergesort solution
Never mind. If we directly sort the entire array the result might not be correct. For example if the original array is 5,2,6,1 and the sorted version is 1,2,5,6, directly calculate the index differences will yield the wrong result for 2.
I was confused about the concept of "stable sort". Can you explain what it is?

RE: Mergesort solution
We only care about the end position difference right? What info do we need from intermediate step?