LeetCode
文章平均质量分 76
iouiwc
这个作者很懒,什么都没留下…
展开
-
LeetCode::Rotate Array C语言
题目Rotate an array of n elements to the right by k steps.For example, with n = 7 and k = 3, the array [1,2,3,4,5,6,7] is rotated to[5,6,7,1,2,3,4]. Note:Try to come up as many solutions a原创 2015-03-08 01:18:25 · 717 阅读 · 1 评论 -
LeetCode::Zigzag Conversion C语言
题目The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility)P A H NA P L原创 2015-03-07 22:36:11 · 1807 阅读 · 0 评论 -
LeetCode::Reverse Integer C语言
题目Reverse digits of an integer.Example1: x = 123, return 321Example2: x = -123, return -321click to show spoilers.Have you thought about this?Here are some good questions to ask before c原创 2015-03-07 21:00:20 · 2584 阅读 · 1 评论 -
LeetCode::Two Sum C语言
题目Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two numbers such that they add up to the target,原创 2015-03-07 15:39:19 · 9819 阅读 · 2 评论 -
LeetCode::Binary Search Tree Iterator
题目Implement an iterator over a binary search tree (BST). Your iterator will be initialized with the root node of a BST.Calling next() will return the next smallest number in the BST.Note: next原创 2015-03-12 17:54:26 · 458 阅读 · 0 评论 -
LeetCode::Merge Sorted Array C++语言
问题Given two sorted integer arrays A and B, merge B into A as one sorted array.Note:You may assume that A has enough space (size that is greater or equal to m +n) to hold additional element原创 2015-03-12 15:39:27 · 431 阅读 · 0 评论 -
LeetCode[85]::Maximal Rectangle C++
Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing all ones and return its area.class Solution {public: int maximalRectangle(vector>& matrix) {原创 2015-08-22 20:45:14 · 606 阅读 · 0 评论 -
LeetCode[91]::Decode Ways C++
A message containing letters from A-Z is being encoded to numbers using the following mapping:'A' -> 1'B' -> 2...'Z' -> 26Given an encoded message containing digits, determine the total number原创 2015-08-22 22:47:21 · 908 阅读 · 0 评论 -
LeetCode[97]::Interleaving String C++
Given s1, s2, s3, find whether s3 is formed by the interleaving ofs1 and s2.For example,Given:s1 = "aabcc",s2 = "dbbca",When s3 = "aadbbcbcac", return true.When s3 = "aadbbbaccc", return原创 2015-08-22 23:40:00 · 852 阅读 · 0 评论