摘要: 题目描述 Given an array nums of n integers where n > 1, return an array output such that output[i] is equal to the product of all the elements of nums exc 阅读全文
posted @ 2019-06-28 15:20 你好哇傻小妞 阅读(91) 评论(0) 推荐(0) 编辑
摘要: 题目描述 Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree. According to the definition of LCA on Wikipedia: “The 阅读全文
posted @ 2019-06-28 14:27 你好哇傻小妞 阅读(176) 评论(0) 推荐(0) 编辑
摘要: 题目描述 Given an integer n, count the total number of digit 1 appearing in all non-negative integers less than or equal to n. 题目大意 计算[0, n]之间的数字中包含多少1 。 阅读全文
posted @ 2019-06-27 20:29 你好哇傻小妞 阅读(159) 评论(0) 推荐(0) 编辑
摘要: 题目描述 Given a binary search tree, write a function kthSmallest to find the kth smallest element in it. Note: You may assume k is always valid, 1 ≤ k ≤ 阅读全文
posted @ 2019-06-27 10:52 你好哇傻小妞 阅读(157) 评论(0) 推荐(0) 编辑
摘要: 题目描述 Given an integer array of size n, find all elements that appear more than ⌊ n/3 ⌋ times. Note: The algorithm should run in linear time and in O(1 阅读全文
posted @ 2019-06-26 16:08 你好哇傻小妞 阅读(100) 评论(0) 推荐(0) 编辑
摘要: 题目描述 Given a sorted integer array without duplicates, return the summary of its ranges. 题目大意 给定一个有序数组,要求将数组中的数字按照连续数字进行分类表示,即前后连续的数字例如0,1,2,3表示为0->3 。 阅读全文
posted @ 2019-06-26 14:57 你好哇傻小妞 阅读(117) 评论(0) 推荐(0) 编辑
摘要: 题目描述 Implement a basic calculator to evaluate a simple expression string. The expression string contains only non-negative integers, +, -, *, / operat 阅读全文
posted @ 2019-06-26 11:13 你好哇傻小妞 阅读(131) 评论(0) 推荐(0) 编辑
摘要: 题目描述 Implement a basic calculator to evaluate a simple expression string. The expression string may contain open ( and closing parentheses ), the plus 阅读全文
posted @ 2019-06-25 19:55 你好哇傻小妞 阅读(116) 评论(0) 推荐(0) 编辑
摘要: 题目描述 Find the total area covered by two rectilinear rectangles in a 2D plane. Each rectangle is defined by its bottom left corner and top right corner 阅读全文
posted @ 2019-06-24 16:33 你好哇傻小妞 阅读(99) 评论(0) 推荐(0) 编辑
摘要: 题目描述 Given a complete binary tree, count the number of nodes. Note: Definition of a complete binary tree from Wikipedia:In a complete binary tree ever 阅读全文
posted @ 2019-06-24 15:10 你好哇傻小妞 阅读(115) 评论(0) 推荐(0) 编辑