上一页 1 ··· 4 5 6 7 8 9 10 下一页
2018年11月18日
摘要: 【题目】 Given an array nums of n integers and an integer target, are there elements a, b, c, and d in nums such that a + b + c + d = target? Find all uni 阅读全文
posted @ 2018-11-18 14:46 alau 阅读(141) 评论(0) 推荐(0) 编辑
摘要: 【题目】 You're given strings J representing the types of stones that are jewels, and S representing the stones you have. Each character in S is a type of 阅读全文
posted @ 2018-11-18 10:23 alau 阅读(71) 评论(0) 推荐(0) 编辑
2018年11月17日
摘要: 【题目】 Given a collection of distinct integers, return all possible permutations. 数组的组合情况。 【思路】 求子集,排列组合的数组题有固定模板。 【代码】 阅读全文
posted @ 2018-11-17 23:06 alau 阅读(116) 评论(0) 推荐(0) 编辑
摘要: 【题目】 Given a collection of integers that might contain duplicates, nums, return all possible subsets (the power set). Note: The solution set must not 阅读全文
posted @ 2018-11-17 22:52 alau 阅读(200) 评论(0) 推荐(0) 编辑
摘要: 【题目】 Given a set of distinct integers, nums, return all possible subsets (the power set). Note: The solution set must not contain duplicate subsets. 求 阅读全文
posted @ 2018-11-17 22:41 alau 阅读(298) 评论(0) 推荐(0) 编辑
2018年11月13日
摘要: 【题目】 Given an array nums of n integers, are there elements a, b, c in nums such that a + b + c = 0? Find all unique triplets in the array which gives 阅读全文
posted @ 2018-11-13 23:44 alau 阅读(134) 评论(0) 推荐(0) 编辑
摘要: 【题目】 Given a binary tree, return the preordertraversal of its nodes' values. Example: 【思路】 有参考,好机智,使用堆栈压入右子树,暂时存储。 左子树遍历完成后遍历右子树。 【代码】 阅读全文
posted @ 2018-11-13 18:44 alau 阅读(107) 评论(0) 推荐(0) 编辑
摘要: 【题目】 给出的升序排序的数组,个数必为奇数,要求形成二叉搜索(平衡)树。 【思路】 辅助函数fun,[0,len]=>[0,mid-1]+[mid+1,len]。 当left>right,返回null。 【AC代码】 阅读全文
posted @ 2018-11-13 18:01 alau 阅读(106) 评论(0) 推荐(0) 编辑
摘要: so basically flag-start is size of the roots left subtree, therefore to get the start of right subtree you gotta get to the start of the first value o 阅读全文
posted @ 2018-11-13 17:40 alau 阅读(171) 评论(0) 推荐(0) 编辑
2018年11月12日
摘要: 【题目】 Given a 2D binary matrix filled with 0's and 1's, find the largest square containing only 1's and return its area. Example: 【思路】 【代码】 阅读全文
posted @ 2018-11-12 23:19 alau 阅读(124) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 下一页