Given an array of integers and an integer k, find out whether there are two distinct indices i and j in the ar…
分类:LeetCode
【leetcode】49. Group Anagrams 字母组合相同的单词聚合
1. 题目 Given an array of strings, group anagrams together. For example, given: [“eat”, “tea…
110.Balanced Binary Tree
Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced binary tree is de…
361. Bomb Enemy解题报告
Description: Given a 2D grid, each cell is either a wall ‘W’, an enemy ‘E’ or empty …
728. Self Dividing Numbers
题目地址:https://leetcode.com/problems/self-dividing-numbers/description/ 大意:判断一个数字各个位上不含数字0,且每个位上的数字都能被这个数字整除,返回给…
Jump Game解题报告
Description: Given an array of non-negative integers, you are initially positioned at the first index of the a…
Leetcode2——Add Two Numbers
文章作者:Tyan 博客:noahsnail.com | CSDN | 简书 1. 问题描述 You are given two non-empty linked list…
LeetCode算法题-Reverse Bits(Java实现)
这是悦乐书的第185次更新,第187篇原创 01 看题和准备 今天介绍的是LeetCode算法题中Easy级别的第44题(顺位题号是190)。给定32位无符号整数,求它的反转位。例如: 输入:43261596 输出:96…
234. Palindrome Linked List
Given a singly linked list, determine if it is a palindrome. Follow up: Could you do it in O(n) time and O(1) …
[LeetCode] Lowest Common Ancestor of a Binary Search Tree 二叉搜索树的最小共同父节点,Validate Binary Search Tree 验证二叉搜索树,Recover Binary Search Tree 复原二叉搜索树,Binary Search Tree Iterator 二叉搜索树迭代器,Unique Binary Search Trees 独一无二的二叉搜索树,Unique Binary Search Trees II 独一无二的二叉搜索树之二,Convert Sorted Array to Binary Search Tree 将有序数组转为二叉搜索树,Convert Sorted List to Binary Search Tree 将有序链表转为二叉搜索树,Kth Smallest Element in a BST 二叉搜索树中的第K小的元素
Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST. …
算法: Assign cookies
Assign Cookies class Solution { func findContentChildren(_ g: [Int], _ s: [Int]) -> Int { var gg = g.sorted…
Leetcode之7-整数反转(Reverse Integer)
前言 个人网站 公众号: 北京程序猿, 网站 : https://yaml.vip 算法题 题干 给出一个 32 位的有符号整数,你需要将这个整数中每位上的数字进行反转。 示例 示例 1: 输入: 123 输出: 321…