Given a string of numbers and operators, return all possible results from computing all the different possible ways to group numbers and operators. Th ...
分类:
其他好文 时间:
2020-07-11 12:41:31
阅读次数:
54
题目描述 编写一个函数,输入是一个无符号整数,返回其二进制表达式中数字位数为 ‘1’ 的个数(也被称为汉明重量)。 示例: 输入:00000000000000000000000000001011 输出:3 解释:输入的二进制串 00000000000000000000000000001011 中,共 ...
分类:
其他好文 时间:
2020-07-11 12:38:03
阅读次数:
64
传送门:题目39 题目40 我觉得比较好的题解:https://leetcode-cn.com/problems/combination-sum/solution/hui-su-suan-fa-jian-zhi-python-dai-ma-java-dai-m-2/ 观察发现[2 2 3]、[2 3 ...
分类:
其他好文 时间:
2020-07-11 12:29:36
阅读次数:
68
https://leetcode.com/problems/remove-all-adjacent-duplicates-in-string/ 给一个字符串,如果出现两个相邻的相同字符,就将它们一同删去,重复这个操作直到不能继续做为止,返回最后的字符串 一开始我是用类似递归的方式重复对这个字符串进行 ...
分类:
其他好文 时间:
2020-07-11 10:06:32
阅读次数:
59
You are given a doubly linked list which in addition to the next and previous pointers, it could have a child pointer, which may or may not point to a ...
分类:
其他好文 时间:
2020-07-11 10:04:24
阅读次数:
84
当一个问题用递推不好描述时,将目光从整体放到局部,用递归描述对于每个元素我们需要做什么。 问题:text 从 point1 、text2 从 point2 开始的最长公共子序列为 n ,具有递归结构,并存在大量重复子问题。 分治: public final int longestCommonSubs ...
分类:
其他好文 时间:
2020-07-11 10:00:21
阅读次数:
62
Given the array nums, for each nums[i] find out how many numbers in the array are smaller than it. That is, for each nums[i] you have to count the num ...
分类:
其他好文 时间:
2020-07-11 09:17:31
阅读次数:
48
壹 ? 引 整理下今天做的算法题,题目难度不高,但在优化角度也是费了一些功夫。题目来自219. 存在重复元素 II,问题描述如下: 给定一个整数数组和一个整数 k,判断数组中是否存在两个不同的索引 i 和 j,使得 nums [i] = nums [j],并且 i 和 j 的差的 绝对值 至多为 k ...
分类:
Web程序 时间:
2020-07-11 00:00:58
阅读次数:
89
题目链接 https://leetcode-cn.com/problems/intersection-of-two-linked-lists/ 初次读题 初次读题可知 两个指针相同即需要求得的结果 链表长度可能不同 两个链表可能没有交叉点,此时返回NULL 不可修改链表结构 链表中无循环 我第一次读 ...
分类:
其他好文 时间:
2020-07-10 23:51:38
阅读次数:
63
编写一个函数来查找字符串数组中的最长公共前缀。 如果不存在公共前缀,返回空字符串 ""。 示例 1: 输入: ["flower","flow","flight"] 输出: "fl" 示例 2: 输入: ["dog","racecar","car"] 输出: "" 解释: 输入不存在公共前缀。 说明: ...
分类:
其他好文 时间:
2020-07-10 21:15:40
阅读次数:
65