Distinct Subsequences Given a string S and a string T, count the number of distinct subsequences of T in S. A …
分类:LeetCode
删除排序数组中的重复项(LeetCode-26)
写在前面:看到很多程序员朋友都在刷LeetCode,刚好最近在学习swift以及数据结构算法,所以用swift刷LeetCode应该是个很好的练习方式。自己会在playground上编写代码及测试,并上传github持续…
[LeetCode] Nth Highest Salary 第N高薪水
Write a SQL query to get the nth highest salary from the Employee table. +----+----…
[LeetCode] Range Addition 范围相加
Assume you have an array of length n initialized with all 0‘s and are given k update operations. …
[LeetCode] Minimum ASCII Delete Sum for Two Strings 两个字符串的最小ASCII删除和
Given two strings s1, s2, find the lowest ASCII sum of deleted characters to make two strings equa…
[LeetCode] Contain Virus 包含病毒
A virus is spreading rapidly, and your task is to quarantine the infected area by installing walls. The…
LeetCode | Combination Sum
题目: Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C …
[剑指offer] 把数组排成最小的数
本文首发于我的个人博客:尾尾部落 题目描述 输入一个正整数数组,把数组里所有数字拼接起来排成一个数,打印能拼接出的所有数字中最小的一个。例如输入数组{3,32,321},则打印出这三个数字能排成的最小数字为321323。…
java-字符串转整形
今天听室友说去京东面试,面试官出了一道算法题,说是让编程实现将字符串转成整形,室友大意了,跪在了算法上。故为室友写下了此文,希望能帮到同样在找工作的小伙伴们。 题目大意: …
Leetcode 163. Missing Ranges
Given a sorted integer array where the range of elements are in the inclusive range [lower, upper], return its…
[LeetCode] Container With Most Water 装最多水的容器,Trapping Rain Water 收集雨水
Given n non-negative integers a1, a2, …, an, where each represents a point at coordinate (i, ai).…
[LeetCode] Copy List with Random Pointer 拷贝带有随机指针的链表
A linked list is given such that each node contains an additional random pointer which could point to a…