- 博客(16)
- 资源 (3)
- 问答 (2)
- 收藏
- 关注
原创 LeetCode 344. Reverse String
题目链接:https://leetcode.com/problems/reverse-string/题目描述:Write a function that takes a string as input and returns the string reversed.Example:Given s = "hello", return "olleh".方法一:借助额外空
2016-09-29 20:12:13 155
原创 LeetCode 292. Nim Game
题目链接:https://leetcode.com/problems/nim-game/题目描述:ou are playing the following Nim Game with your friend: There is a heap of stones on the table, each time one of you take turns to remove 1 to
2016-09-29 20:05:37 156
原创 约瑟夫问题
代码:#include "stdafx.h"#include using namespace std;struct ListNode { int val; ListNode *next; ListNode(int x) : val(x), next(NULL) {}};void main(){ ListNode* head = new ListNode
2016-09-28 21:11:42 258
原创 Leetcode 234. Palindrome Linked List
题目链接:https://leetcode.com/problems/palindrome-linked-list/题目描述:Given a singly linked list, determine if it is a palindrome.Follow up:Could you do it in O(n) time and O(1) space?S
2016-09-28 20:12:43 153
原创 Leetcode 136. single number
题目链接:https://leetcode.com/problems/single-number/题目描述:Given an array of integers, every element appears twice except for one. Find that single one.Note:Your algorithm should have a linea
2016-09-27 21:20:08 186
原创 LeetCode 27. Remove Element
题目链接:https://leetcode.com/problems/remove-element/题目描述:Given an array and a value, remove all instances of that value in place and return the new length.Do not allocate extra space for ano
2016-09-26 20:28:01 194
原创 LeetCode 394. Decode String LeetCode 385. Mini Parser
题目链接:https://leetcode.com/problems/decode-string/题目描述:The encoding rule is: k[encoded_string], where the encoded_string inside the square brackets is being repeated exactly k times. Note tha
2016-09-16 21:07:08 355
原创 LeetCode 127. Word Ladder
题目链接:https://leetcode.com/problems/word-ladder/题目描述:Given two words (beginWord and endWord), and a dictionary's word list, find the length of shortest transformation sequence frombeginWord to
2016-09-13 14:51:51 251
原创 LeetCode 242. Valid Anagram
题目链接:https://leetcode.com/problems/valid-anagram/题目描述:Given two strings s and t, write a function to determine if t is an anagram of s.For example,s = "anagram", t = "nagaram", return tr
2016-09-12 17:22:53 158
原创 LeetCode 75. Sort Colors
题目链接:https://leetcode.com/problems/sort-colors/题目描述:Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the o
2016-09-11 19:09:29 181
原创 Leetcode 38. Count and Say
题目链接:https://leetcode.com/problems/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" o
2016-09-11 16:09:28 179
原创 LeetCode 34. Search for a Range(binary search)
题目链接:https://leetcode.com/problems/search-for-a-range/题目描述:Given a sorted array of integers, find the starting and ending position of a given target value.Your algorithm's runtime complexi
2016-09-07 21:57:57 161
原创 LeetCode 121. Best Time to Buy and Sell Stock(dynamic programming)
题目链接:https://leetcode.com/problems/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
2016-09-06 21:34:40 173
原创 LeetCode 122. Best Time to Buy and Sell Stock II(greedy)
题目链接:https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/题目描述:Say you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to fin
2016-09-06 21:26:12 330
原创 LeetCode 53. Maximum Subarray(dynamic programming)
题目链接:https://leetcode.com/problems/maximum-subarray/题目描述:Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the arra
2016-09-06 19:09:31 357
原创 LeetCode 39.Combination Sum,40. Combination Sum II,216. Combination Sum III
题目链接:https://leetcode.com/problems/combination-sum/题目描述:Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T.
2016-09-05 21:05:14 296
数字逻辑电路课程设计自动洗涤系统设计
2014-06-25
win PC 端用C++如何获取连接的网络类型(无线网或者有线网)
2018-10-29
求拓扑保持的level set的代码
2016-11-22
TA创建的收藏夹 TA关注的收藏夹
TA关注的人