摘要:
Given a non-empty binary search tree and a target value, find k values in the BST that are closest to the target.Note:Given target value is a floating... 阅读全文
摘要:
If I choose / as spliter, how to ensure the other / wouldn't be seen as spliter? The idea is to store length of the str This one will be encoded as "6 阅读全文
摘要:
Given a non-empty binary search tree and a target value, find the value in the BST that is closest to the target.Note:Given target value is a floating... 阅读全文
摘要:
Best Solution: Bit manipulation The basic idea is to use XOR operation. We all know that a^b^b =a, which means two xor operations with the same number 阅读全文
摘要:
This problem can be solved by using union find, reference this blog:https://segmentfault.com/a/1190000003791051 复杂度 时间 O(N^M) 空间 O(N) 思路 判断输入的边是否能构成一个 阅读全文