LeetCode之贪心
黄焖鸡米饭啊
嗯。
展开
-
One_Edit_Distance
题目描述:Given two strings S and T, determine if they are both one edit distance apart.(判断两个字串能否只进行一次操作就使两字串相等。)思路:(1)如果两个字串的长度之差大于1,那么就不可能只通过一次操作使两字串相等,故直接返回false。 (2)如果两个字串的长度之差等于1,那么两个字串在原创 2018-02-15 18:51:11 · 157 阅读 · 0 评论 -
Jump Game低时间复杂度版
题目描述: Given an array of non-negative(非负) integers, you are initially positioned at the first index of the array. Each element in the array represents your maximum jump length at that posi原创 2017-08-14 12:22:30 · 258 阅读 · 0 评论 -
Jump_Game
题目描述:Given an array of non-negative(非负) integers, you are initially positioned at the first index of the array. Each element in the array represents your maximum j原创 2017-06-05 15:33:26 · 217 阅读 · 0 评论 -
Divide_Two_Integers
题目描述:Divide two integers without using multiplication, division and mod operator. (除两个数不使用乘除取余) 解析:用一个数一直减另一个数,直到小于零,得到答案,比较容易理解但是可能时间复杂度上不是最低,不过int类型也高不到哪去。publ原创 2017-06-01 20:48:59 · 304 阅读 · 0 评论 -
Add_Binary
题目描述:Given two binary(二进制的)strings, return their sum (also a binary string). For example, a = "11" b = "1" Return "100". public原创 2017-05-30 18:13:29 · 231 阅读 · 0 评论 -
ZigZag_Conversion
题目描述:The string "PAYPALISHIRING" is written in a zigzag( Z字形的)pattern on a given number of rows like this: (you may want to display this pattern in a fixed font f原创 2017-05-25 18:14:57 · 292 阅读 · 0 评论 -
Palindrome_Number
题目描述:Determine whether an integer is a palindrome. Do this without extra space. (判断一个整数是否为回文。没有多余的空间.)public class Palindrome_Number { public static ArrayList al=new ArrayList();原创 2017-05-25 18:13:25 · 235 阅读 · 0 评论 -
Search a 2D Matrix II
题目描述:Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties:1.Integers in each row are sorted in ascending from left to right.2.Integers in...原创 2018-07-10 20:16:56 · 103 阅读 · 0 评论