Given two words word1 and word2, find the minimum number of steps required to make …
分类:LeetCode
[LeetCode] Minimum Distance Between BST Nodes 二叉搜索树中结点的最小距离
Given a Binary Search Tree (BST) with the root node root, return the minimum difference betwe…
187. Repeated DNA Sequences
All DNA is composed of a series of nucleotides abbreviated as A, C, G, and T, for example: “ACGAATTCCG…
LeetCode 16. 3Sum Closest
题目 给一个包含 n 个整数的数组 S, 找到和与给定整数 target 最接近的三元组,返回这三个数的和。 注意事项 只需要返回三元组之和,无需返回三元组本身 样例 例如 S = [-1, 2, 1, -4] and …
Leetcode PHP题解--D9 657. Robot Return to Origin
657. Robot Return to Origin 题目链接 657. Robot Return to Origin 题目分析 输入一串指令操作机器人,判断执行完指令后,能否回到原点。 思路 判断向上移动的次数是否等…
[LeetCode By Go 108]438. Find All Anagrams in a String
题目的通过率越来越低,题目越来越长,题意不好理解,边界问题,优化问题叠加,导致解题时间大大增加,对我的目标–快速复习一遍技术数据结构和算法阻碍很大啊!已经写了一百多道题了,是时候针对性的做一些题目了。目前打算…
[LeetCode] H-Index II 求H指数之二,H-Index 求H指数
Follow up for H-Index: What if the citations array is sorted in ascending order? Could you optimize you…
[LeetCode] Largest Divisible Subset 最大可整除的子集合
Given a set of distinct positive integers, find the largest subset such that every pair (Si, Sj) of ele…
LeetCode 001 Two Sum
题目描述 Given an array of integers, find two numbers such that they add up to a specific target number. The funct…
leetcode 题解 84. Largest Rectangle in Histogram (单调栈的应用们)
leetcode 题解 84. Largest Rectangle in Histogram (单调栈的应用们) Given n non-negative integers representing the histog…
Leetcode PHP题解--D6 595. Big Countries
595. Big Countries 题目链接 595. Big Countries 题目分析 这道题是个SQL题。 要求返回国土面积大于300万平方公里或者人口多于2500万人的国家的名称、人口、面积。 思路 国土面积…
[LeetCode] Encode and Decode Strings 加码解码字符串
Design an algorithm to encode a list of strings to a string. The encoded string is then …