![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法
YT的呼呼
这个作者很懒,什么都没留下…
展开
-
Integer to Roman
Given an integer, convert it to a roman numeral. Input is guaranteed to be within the range from 1 to 3999. Subscribe to see which companies asked this question 傻瓜算法,全部列举出来,然后基于各个位的值找到相应的字符原创 2016-12-30 10:11:29 · 155 阅读 · 0 评论 -
House Robber II(middle)
Note: This is an extension of House Robber. After robbing those houses on that street, the thief has found himself a new place for his thievery so that he will not get too much attention. This time原创 2017-02-22 20:42:34 · 201 阅读 · 0 评论 -
Count and Say
The count-and-say sequence is the sequence of integers beginning as follows: 1, 11, 21, 1211, 111221, ... 1 is read off as "one 1" or 11. 11 is read off as "two 1s" or 21. 21 is read off as "one 2原创 2017-01-12 16:37:40 · 137 阅读 · 0 评论 -
Binary Tree Level Order Traversal
Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level). For example: Given binary tree [3,9,20,null,null,15,7], 3 / \ 9 2原创 2017-01-17 20:37:07 · 194 阅读 · 0 评论 -
Letter Combinations of a Phone Number(middle)
Given a digit string, return all possible letter combinations that the number could represent. A mapping of digit to letters (just like on the telephone buttons) is given below. Input:Digit string "原创 2017-01-16 15:58:03 · 199 阅读 · 0 评论 -
5. Longest Palindromic Substring(middle)
Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000. Example: Input: "babad" Output: "bab" Note: "aba" is also a valid answer.原创 2017-01-15 20:43:45 · 136 阅读 · 0 评论 -
Swap Nodes in Pairs
Given a linked list, swap every two adjacent nodes and return its head. For example, Given 1->2->3->4, you should return the list as 2->1->4->3. Your algorithm should use only constant space. Y原创 2017-01-11 00:10:25 · 235 阅读 · 0 评论 -
Add Binary
Given two binary strings, return their sum (also a binary string). For example, a = "11" b = "1" Return "100". 题意就是实现二进制的运算。下面程序精简且巧妙。 class Solution { public: string addBinary(string原创 2017-01-13 15:51:11 · 131 阅读 · 0 评论 -
3Sum-Leetcode
Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero. Note: The solution set must not contain原创 2017-01-02 22:34:21 · 154 阅读 · 0 评论 -
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). Fin原创 2016-12-30 08:20:31 · 133 阅读 · 0 评论 -
4Sum(middle)
Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets in the array which gives the sum of target. Note: The solution原创 2017-01-31 16:37:03 · 177 阅读 · 0 评论