leetcode
Zhou_xinke
这个作者很懒,什么都没留下…
展开
-
leetcode 31. Next Permutation
Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangement is not possible, it must rearrange it as the lowest possible ...原创 2018-08-27 10:20:13 · 421 阅读 · 0 评论 -
# 682.Baseball Game
You're now a baseball game point recorder.Given a list of strings, each string can be one of the 4 following types:Integer (one round's score): Directly represents the number of points you get in ...原创 2018-10-23 15:36:09 · 206 阅读 · 0 评论 -
20.Valid Parentheses
Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.An input string is valid if:Open brackets must be closed by the same type of b...原创 2018-10-22 18:25:06 · 205 阅读 · 0 评论 -
leetcode 709. To Lower Case
Implement function ToLowerCase() that has a string parameter str, and returns the same string in lowercase. Example 1: Input: "Hello" Output: "hello" Example 2: Input...原创 2018-09-07 16:52:32 · 222 阅读 · 0 评论 -
70. Climbing Stairs
You are climbing a stair case. It takes n steps to reach to the top.Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?Note: Given n will be a positive...原创 2018-08-30 15:03:50 · 158 阅读 · 0 评论 -
746. Min Cost Climbing Stairs
On a staircase, the i-th step has some non-negative cost cost[i] assigned (0 indexed).Once you pay the cost, you can either climb one or two steps. You need to find minimum cost to reach the top of ...原创 2018-08-30 14:48:59 · 168 阅读 · 0 评论 -
leetcode 27. Remove Element
Given an array nums and a value val, remove all instances of that value in-place and return the new length.Do not allocate extra space for another array, you must do this by modifying the input arra...原创 2018-08-25 16:01:39 · 165 阅读 · 0 评论 -
leetcode 26. Remove Duplicates from Sorted Array
Given a sorted array nums, remove the duplicates in-place such that each element appear only once and return the new length.Do not allocate extra space for another array, you must do this by modifyi...原创 2018-08-25 15:18:01 · 238 阅读 · 0 评论 -
leetcode 11. Container With Most Water
Given n non-negative integers a1, a2, ..., an , where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i, 0). Find two...原创 2018-08-25 11:00:46 · 162 阅读 · 0 评论 -
leetcode 830. Positions of Large Groups
In a string S of lowercase letters, these letters form consecutive groups of the same character.For example, a string like S = "abbxxxxzyy" has the groups "a", "bb", "xxxx", "z" and "yy".Call原创 2018-08-29 16:42:09 · 29896 阅读 · 0 评论 -
leetcode 849. Maximize Distance to Closest Person
In a row of seats, 1 represents a person sitting in that seat, and 0 represents that the seat is empty. There is at least one empty seat, and at least one person sitting.Alex wants to sit in the s...原创 2018-08-29 15:22:21 · 191 阅读 · 0 评论 -
leetcode 832. Flipping an Image
Given a binary matrix A, we want to flip the image horizontally, then invert it, and return the resulting image.To flip an image horizontally means that each row of the image is reversed. For examp...原创 2018-08-29 11:21:06 · 272 阅读 · 1 评论 -
leetcode 840. Magic Squares In Grid
A 3 x 3 magic square is a 3 x 3 grid filled with distinct numbers from 1 to 9 such that each row, column, and both diagonals all have the same sum.Given an grid of integers, how many 3 x 3 "magic sq...原创 2018-08-29 09:58:31 · 236 阅读 · 0 评论 -
leetcode 198. House Robber
You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjacent house...原创 2018-08-30 16:54:27 · 237 阅读 · 0 评论 -
leetcode 121. Best Time to Buy and Sell Stock
Say you have an array for which the ith element is the price of a given stock on day i.If you were only permitted to complete at most one transaction (i.e., buy one and sell one share of the stock),...原创 2018-08-30 16:16:26 · 163 阅读 · 0 评论 -
844.Backspace String Compare
Given two strings S and T, return if they are equal when both are typed into empty text editors. # means a backspace character.Example 1:Input: S = "ab#c", T = "ad#c"Output: trueExplanation: Bot...原创 2018-10-23 15:55:28 · 300 阅读 · 0 评论