题目: Given a string S and a string T, count the number of distinct subsequences of T i…
分类:LeetCode
LeetCode 068 Text Justification
题目描述 Given an array of words and a length L, format the text such that each line has exactly L characters and …
1.TwoSum(两数之和)
写在coding前 题目(Easy) 给定一个整数数列,找出其中和为特定值的那两个数,并返回这符合条件的数的下标。 你可以假设每个输入都只会有一种答案,同样的元素不能被重用。 示例: 给定 nums = [2, 7, 1…
149. Max Points on a Line
Hard 今天上午有幸参加了Refdash的免费Mock interview, 被暴击一万点.不过先刷完L家tag题再说那道题吧. 这也是一道逻辑其实很简单,但是很多细节容易出错的题. 要找到共线最多的点,我们主线是通过…
[LeetCode By Go 23]258. Add Digits
题目 Given a non-negative integer num, repeatedly add all its digits until the result has only one digit. For ex…
LeetCode | Best Time to Buy and Sell Stock II(股票购买抛售问题II)
Say you have an array for which the ith element is the price of a given stock on day i. Design …
[array] leetcode - 40. Combination Sum II - Medium
leetcode – 40. Combination Sum II – Medium descrition Given a collection of candidate numbers (C) …
leetcode 20 有效的括号
思路: 一个符号数组,[“{“, “[“, “(“, “}”, “]”, “)̶…
LeetCode算法题-Perfect Number(Java实现)
这是悦乐书的第249次更新,第262篇原创 01 看题和准备 今天介绍的是LeetCode算法题中Easy级别的第116题(顺位题号是507)。我们定义Perfect Number是一个正整数,它等于除了它自己之外的所有…
[LeetCode] Super Ugly Number 超级丑陋数
Write a program to find the nth super ugly number. Super ugly numbers are positive numbers whose a…
95. Unique Binary Search Trees II
Given an integer n, generate all structurally unique BST’s (binary search trees) that store values 1 …
[Leetcod] Generate Parentheses 产生括号
Generate Parentheses 最新更新请见:https://yanjia.me/zh/2019/01/… Given n pairs of parentheses, write a functio…