1. 记一下

    Leave a comment

    May 23, 2018 by oneOokay

    脸书店面: decode string LC 394. 印度人. 我紧张. 模糊的想到可以用stack,但是没有好好想好思路就开始写,没写通.写到一半换DFS(大忌). 面试官问, 你为什么觉得用DFS比用stack好呢…没get到这个hint, 继续跟DFS嗑. 还问能不能在纸上画…最后没时间了依旧没写出来,说了一下还是应该用stack做, 面试官说stack是对的.囧. 电话挂了之后5分钟写出来了.嚎啕大哭=.= 优步店面: 给你两个list of intervals, find there …
    Continue reading

  2. Friend Circles

    Leave a comment

    February 20, 2018 by oneOokay

    There are N students in a class. Some of them are friends, while some are not. Their friendship is transitive in nature. …
    Continue reading

  3. BST: Inorder Successor and Predecessor

    Leave a comment

    February 8, 2018 by oneOokay

    iterative还okay. 主要是用recursive的写法. 我写的比较吃藕. 直接把人家的copy过来放这. //我的 public TreeNode inorderSuccessor(TreeNode root, TreeNode p) { return helper(null, root, p); } private TreeNode helper(TreeNode …
    Continue reading

  4. Contiguous Array

    Leave a comment

    February 8, 2018 by oneOokay

    Given a binary array, find the maximum length of a contiguous subarray with equal number of 0 and 1. Example …
    Continue reading

  5. Reservoir Sampling solution

    Leave a comment

    February 7, 2018 by oneOokay

    Random Pick Index

  6. 线段树???

    Leave a comment

    February 5, 2018 by oneOokay

    Number of Longest Increasing Subsequence

  7. TODO: Category Index Page….

    Leave a comment

    February 4, 2018 by oneOokay

    TODO: Category Page….