摘要: 题目: Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive. 给定整数数组nums,找到索引i和j(i≤j)之间的元素之和,包括端点。 Example 阅读全文
posted @ 2018-09-10 22:42 chan_ai_chao 阅读(98) 评论(0) 推荐(0) 编辑
摘要: 题目: Given a binary tree, find its minimum depth. 给定二叉树,找到它的最小深度。 The minimum depth is the number of nodes along the shortest path from the root node d 阅读全文
posted @ 2018-09-10 22:14 chan_ai_chao 阅读(86) 评论(0) 推荐(0) 编辑
摘要: 题目: 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 elem 阅读全文
posted @ 2018-09-10 20:08 chan_ai_chao 阅读(95) 评论(0) 推荐(0) 编辑
摘要: 题目: Given a singly linked list, determine if it is a palindrome. 给出一个单链表,确定它是否是回文。 Example 1: Example 2: Follow up:Could you do it in O(n) time and O( 阅读全文
posted @ 2018-09-10 14:58 chan_ai_chao 阅读(129) 评论(0) 推荐(0) 编辑