Given a string containing only digits, restore it by returning all possible valid IP address combinations. For…
分类:LeetCode
Leetcode PHP题解--D4 961. N-Repeated Element in Size 2N Array
961. N-Repeated Element in Size 2N Array 题目链接 961. N-Repeated Element in Size 2N Array 题目分析 在长度为2N的数组A中,有N+1个元…
LeetCode算法题-Merge Two Binary Trees(Java实现)
这是悦乐书的第274次更新,第290篇原创 01 看题和准备 今天介绍的是LeetCode算法题中Easy级别的第142题(顺位题号是617)。提供两个二叉树,将其合并为新的二叉树,也可以在其中一个二叉树上进行覆盖。合并…
LeetCode 447. Number of Boomerangs
题意:在一堆点中找符合条件的点的总组数:每组点共有三个,且第一个点到第二个点和到第三个点的距离相同。点的顺序不同表示不同的组数。 解题:用一个map记录遍历的该点point1的信息,key表示该点到另外点point2的距…
[LeetCode By Go 91]459. Repeated Substring Pattern
题目 Given a non-empty string check if it can be constructed by taking a substring of it and appending multiple …
[LeetCode By Go 747] Easy, Array, 747. Largest Number At Least Twice of Others
题目 In a given integer array nums, there is always exactly one largest element. Find whether the largest elemen…
[LeetCode] Sentence Screen Fitting 调整屏幕上的句子
Given a rows x cols screen and a sentence represented by a list of words, find how many …
LeetCode | Longest Valid Parentheses
题目: Given a string containing just the characters '(' and ')', find the length of the longest v…
230. Kth Smallest Element in a BST
Given a binary search tree, write a function kthSmallest to find the kth smallest element in it.Note: You may …
LeetCode | Jump Game II(跳跃游戏II)
Given an array of non-negative integers, you are initially positioned at the first index of the array. Each el…
binary-tree-zigzag-level-order-traversal
描述: Given a binary tree, return the zigzag level order traversal of its nodes’ values. (ie, from left to…
Day3. Remove Element(27)
问题描述 Given an array and a value, remove all instances of that value in-place and return the new length.Do not …