算法

【LeetCode】7.Reverse Integer 【LeetCode】7.Reverse Integer
1 问题Given a signed 32-bit integer x, return x with its digits reversed. If reversing x causes the value to go outside th
2024-01-30
【LeetCode】190.Reverse Bits 【LeetCode】190.Reverse Bits
1 问题Reverse bits of a given 32 bits unsigned integer. Note: Note that in some languages, such as Java, there is no unsi
2024-01-30
【LeetCode】338.Counting Bits 【LeetCode】338.Counting Bits
1 问题Given an integer n, return an array ans of length n + 1 such that for each i (0 <= i <= n), ans[i] i
2024-01-30
【LeetCode】191.Number of 1 Bits 【LeetCode】191.Number of 1 Bits
1 问题Write a function that takes the binary representation of an unsigned integer and returns the number of ‘1’ bits it h
2024-01-30
【LeetCode】20.Valid Parentheses 【LeetCode】20.Valid Parentheses
1 问题Given a string s containing just the characters ‘(‘, ‘)’, ‘{‘, ‘}’, ‘[‘ and ‘]’, determine if the input string is va
2024-01-24
【LeetCode】22.Generate Parentheses 【LeetCode】22.Generate Parentheses
1 问题Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. 1.1 实例一 Inpu
2024-01-24
【LeetCode】12.整数转罗马数字 【LeetCode】12.整数转罗马数字
1 问题罗马数字包含以下七种字符: I, V, X, L,C,D 和 M。 字符 数值 I 1 V 5 X 10 L 50 C
2023-08-10
【LeetCode】13.罗马数字转整数 【LeetCode】13.罗马数字转整数
1 问题罗马数字包含以下七种字符: I, V, X, L,C,D 和 M。 字符 数值 I 1 V 5 X 10 L 50 C
2023-08-10
【LeetCode】3.无重复字符的最长子串 【LeetCode】3.无重复字符的最长子串
1 问题给定一个字符串 s ,请你找出其中不含有重复字符的最长子串的长度。 示例 1 输入: s = “abcabcbb”输出: 3解释: 因为无重复字符的最长子串是 “abc”,所以其长度为 3。 示例 2 输入: s &#x
2023-08-08
【LeetCode】543.二叉树的直径 【LeetCode】543.二叉树的直径
1 问题给你一棵二叉树的根节点,返回该树的直径。 二叉树的直径是指树中任意两个节点之间最长路径的长度。这条路径可能经过也可能不经过根节点 root 。 两节点之间路径的长度由它们之间边数表示。 示例 1 输入:root = [1
2023-07-25
【LeetCode】501.二叉搜索树中的众数 【LeetCode】501.二叉搜索树中的众数
1 问题给你一个含重复值的二叉搜索树(BST)的根节点 root ,找出并返回 BST 中的所有众数(即,出现频率最高的元素)。 如果树中有不止一个众数,可以按任意顺序返回。 假定 BST 满足如下定义: 结点左子树中所含节点的值小于等于
2023-07-25
【LeetCode】515.在每个树行中找最大值 【LeetCode】515.在每个树行中找最大值
1 问题给定一棵二叉树的根节点root ,请找出该二叉树中每一层的最大值。 示例1示例1 输入: root = [1,3,2,5,3,null,9]输出: [1,3,9] 示例2 输入: root = [1,2,3
2023-07-20
1 / 5