Inorder Successor in BST Given a binary search tree and a node in it, find the in-order successor of that node…
分类:LeetCode
【leetcode】25. Reverse Nodes in k-Group 链表按K分段逆序
1. 题目 Given a linked list, reverse the nodes of a linked list k at a time and return its modified list. If the…
LeetCode | Validate Binary Search Tree(有效的二叉搜索树)
Given a binary tree, determine if it is a valid binary search tree (BST). Assume a BST is defined as follows: …
LeetCode | Longest Palindromic Substring(最长回文子串)
题目: Given a string S, find the longest palindromic substring in S. You may assume that the maximum l…
LeetCode算法题-Repeated Substring Pattern(Java实现)
这是悦乐书的第236次更新,第249篇原创 01 看题和准备 今天介绍的是LeetCode算法题中Easy级别的第103题(顺位题号是459)。给定非空字符串检查是否可以通过获取它的子字符串并将子字符串的多个副本附加在一…
276. Paint Fence
276- Paint Fence **My SubmissionsQuestion Editorial Solution Total Accepted: 10079 Total Submissions: 31886 Di…
leetcode 1037. 有效的回旋镖(三点共线问题)
【题目】1037. 有效的回旋镖 1037. 有效的回旋镖 1232. 缀点成线 回旋镖定义为一组三个点,这些点各不相同且不在一条直线上。 给出平面上三个点组成的列表,判断这些点是否可以构成回旋镖。 示例 1: 输入:[…
[LeetCode] House Robber III 打家劫舍之三
The thief has found himself a new place for his thievery again. There is only one entrance to this area…
[LeetCode] Basic Calculator III 基本计算器之三
Implement a basic calculator to evaluate a simple expression string. The expression string may contain …
[Leetcode] Course Schedule 课程计划
Course Schedule I There are a total of n courses you have to take, labeled from 0 to n – 1. Some courses…
[Leetcode] Longest Substring Without Repeating Characters 最长唯一子串
Longest Substring Without Repeating Characters 最新更新解法:https://yanjia.me/zh/2018/12/… Given a string, fin…
202. Happy Number
Easy 看了discussion借鉴了一个用set来判断结束游戏的方法,如果set.add(a) return false的话,说明set里面已经有a了,此时继续游戏会无限循环根据题意可以判断不是happy numbe…