My code: public class Solution { public String toHex(int num) { if (num == 0) { return "0"; } String[] strs = …
分类:LeetCode
Leetcode 115.Distinct Subsequences
Given a string S and a string T, count the number of distinct subsequences of S which equals T. A subsequence …
LeetCode刷题之Valid Palindrome
Problem Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring…
35. Search Insert Position
35. Search Insert Position 题目 Given a sorted array and a target value, return the index if the target is found…
[LeetCode] Guess Number Higher or Lower II 猜数字大小之二
We are playing the Guess Game. The game is as follows: I pick a number from 1 to …
[LeetCode] 2 Keys Keyboard 两键的键盘
Initially on a notepad only one character ‘A’ is present. You can perform two operations on…
LeetCode算法题-Balanced Binary Tree(Java实现)
这是悦乐书的第167次更新,第169篇原创 01 看题和准备 今天介绍的是LeetCode算法题中Easy级别的第26题(顺位题号是110)。给定二叉树,判断它是否是高度平衡的。对于此问题,高度平衡二叉树定义为:一个二叉…
583. 两个字符串的删除操作
class Solution(object): def minDistance(self, s1, s2): """ :type word1: str :type word2: str :rtype: int """ #…
[LeetCode By Go 9]344. Reverse String
题目 Write a function that takes a string as input and returns the string reversed. Example: Given s = “he…
[LeetCode] Subsets II 子集合之二
Given a collection of integers that might contain duplicates, S, return all possible subsets. Note…
[LeetCode] Queue Reconstruction by Height 根据高度重建队列
Suppose you have a random list of people standing in a queue. Each person is described by a pair of int…
[LeetCode] Number of Atoms 原子的个数
Given a chemical formula (given as a string), return the count of each atom. An atomic elemen…