2019年1月2日

摘要: Design a class to find the kth largest element in a stream. Note that it is the kth largest element in the sorted order, not the kth distinct element. 阅读全文
posted @ 2019-01-02 20:09 chiyeung 阅读(129) 评论(0) 推荐(0) 编辑

2018年12月30日

摘要: Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). For example, this binary tree [1,2,2,3,4,4,3] is symmet 阅读全文
posted @ 2018-12-30 19:50 chiyeung 阅读(105) 评论(0) 推荐(0) 编辑

2018年12月28日

摘要: Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum. Example: Foll 阅读全文
posted @ 2018-12-28 17:45 chiyeung 阅读(81) 评论(0) 推荐(0) 编辑

2018年12月27日

摘要: We define a harmonious array is an array where the difference between its maximum value and its minimum value is exactly 1. Now, given an integer arra 阅读全文
posted @ 2018-12-27 18:31 chiyeung 阅读(108) 评论(0) 推荐(0) 编辑

2018年12月26日

摘要: Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST. According to the definition of LCA on Wikipedia 阅读全文
posted @ 2018-12-26 18:14 chiyeung 阅读(109) 评论(0) 推荐(0) 编辑
摘要: Given a sorted (in ascending order) integer array nums of n elements and a target value, write a function to search target in nums. If target exists, 阅读全文
posted @ 2018-12-26 17:51 chiyeung 阅读(80) 评论(0) 推荐(0) 编辑

2018年12月23日

摘要: Given two non-negative integers num1 and num2 represented as string, return the sum of num1 and num2. Note: 阅读全文
posted @ 2018-12-23 16:26 chiyeung 阅读(93) 评论(0) 推荐(0) 编辑
摘要: You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can you cl 阅读全文
posted @ 2018-12-23 14:59 chiyeung 阅读(96) 评论(0) 推荐(0) 编辑

2018年12月22日

摘要: Given an array nums and a value val, remove all instances of that value in-placeand return the new length. Do not allocate extra space for another arr 阅读全文
posted @ 2018-12-22 15:46 chiyeung 阅读(104) 评论(0) 推荐(0) 编辑
摘要: Given a non-empty special binary tree consisting of nodes with the non-negative value, where each node in this tree has exactly two or zero sub-node. 阅读全文
posted @ 2018-12-22 11:49 chiyeung 阅读(102) 评论(0) 推荐(0) 编辑

导航