- 博客(36)
- 收藏
- 关注
原创 41. First Missing Positive
题目原网址为https://leetcode.com/problems/first-missing-positive/description/一、题目Given an unsorted integer array, find the first missing positive integer.For example,Given [1,2,0] return 3,a
2018-01-20 23:55:09 171
原创 97. Interleaving String
题目原网址为https://leetcode.com/problems/interleaving-string/description/一、题目Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2.For example,Given:s1 = "aabcc",s2
2018-01-20 23:52:22 185
原创 214. Shortest Palindrome
题目原网址为https://leetcode.com/problems/shortest-palindrome/description/一、题目Given a string S, you are allowed to convert it to a palindrome by adding characters in front of it. Find and return the
2018-01-20 23:49:35 183
原创 132. Palindrome Partitioning II
题目原网址为https://leetcode.com/problems/palindrome-partitioning-ii/description/一、题目Given a string s, partition s such that every substring of the partition is a palindrome.Return the minimum cut
2018-01-20 23:46:36 143
原创 212. Word Search II
原网址为https://leetcode.com/problems/word-search-ii/description/一、题目Given a 2D board and a list of words from the dictionary, find all words in the board.Each word must be constructed from le
2018-01-15 23:35:50 186
原创 30. Substring with Concatenation of All Words
原网址为https://leetcode.com/problems/substring-with-concatenation-of-all-words/description/一、题目You are given a string, s, and a list of words, words, that are all of the same length. Find all sta
2018-01-07 23:36:57 160
原创 一个NP完全问题的证明
一、题目(出自算法概论注释版的习题8.14)Prove that the following problem is NP-complete: given an undirected graph G = (V, E) and an integer k, return a clique of size k as well as an independent set of size k, pro
2017-12-31 18:55:21 420
原创 4. Median of Two Sorted Arrays
题目原网址为https://leetcode.com/problems/median-of-two-sorted-arrays/description/一、题目There are two sorted arrays nums1 and nums2 of size m and n respectively.Find the median of the two sorted a
2017-12-24 20:13:18 115
原创 745. Prefix and Suffix Search
原网址为 https://leetcode.com/problems/prefix-and-suffix-search/description/Given many words, words[i] has weight i.Design a class WordFilter that supports one function, WordFilter.f(String prefix
2017-12-17 14:00:50 369
原创 84. Largest Rectangle in Histogram
原网址https://leetcode.com/problems/largest-rectangle-in-histogram/description/Given n non-negative integers representing the histogram's bar height where the width of each bar is 1, find the area of
2017-12-10 19:22:42 150
原创 140. Word Break II
原网址为 https://leetcode.com/problems/word-break-ii/description/Given a non-empty string s and a dictionary wordDict containing a list of non-empty words, add spaces in s to construct a sentence wh
2017-12-03 22:12:05 126
原创 91. Decode Ways
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 nu
2017-12-03 22:09:08 362
原创 120. Triangle
原网址为 https://leetcode.com/problems/triangle/description/Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For example,
2017-11-26 23:35:57 146
原创 718. Maximum Length of Repeated Subarray
原网址为https://leetcode.com/problems/maximum-length-of-repeated-subarray/description/Given two integer arrays A and B, return the maximum length of an subarray that appears in both arrays.Example 1
2017-11-26 22:05:17 148
原创 44. Wildcard Matching
原网址为https://leetcode.com/problems/wildcard-matching/description/一、题目Implement wildcard pattern matching with support for '?' and '*'.'?' Matches any single character.'*' Matches any sequenc
2017-11-19 20:41:28 141
原创 32. Longest Valid Parentheses
原网址为https://leetcode.com/problems/longest-valid-parentheses/description/一、题目Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) pare
2017-11-12 18:28:52 141
原创 10. Regular Expression Matching
原网址为https://leetcode.com/problems/regular-expression-matching/description/一、题目Implement regular expression matching with support for '.' and '*'.'.' Matches any single character.'*' Mat
2017-11-05 11:56:06 139
原创 413. Arithmetic Slices
原网址为https://leetcode.com/problems/arithmetic-slices/description/一、题目A sequence of number is called arithmetic if it consists of at least three elements and if the difference between any two co
2017-10-30 00:50:07 240
原创 494. Target Sum
原网站为https://leetcode.com/problems/target-sum/description/一、题目You are given a list of non-negative integers, a1, a2, ..., an, and a target, S. Now you have 2 symbols + and -. For each integer
2017-10-29 19:59:01 183
原创 135. Candy
原网址为https://leetcode.com/problems/candy/description/一、题目There are N children standing in a line. Each child is assigned a rating value.You are giving candies to these children subjected to t
2017-10-21 16:55:36 164
原创 122. Best Time to Buy and Sell Stock II
原网页为https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/description/一、题目Say you have an array for which the ith element is the price of a given stock on day i.Design an algori
2017-10-15 00:27:57 133
原创 72. Edit Distance
原网址为https://leetcode.com/problems/edit-distance/description/一.题目Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each operation is counted
2017-10-14 23:33:12 136
原创 65. Valid Number
一、原网址为https://leetcode.com/problems/valid-number/description/二、题目Validate if a given string is numeric.Some examples:"0" => true" 0.1 " => true"abc" => false"1 a" => false"2e10
2017-10-08 20:56:06 176
原创 Minimum Path Sum
一、题目64. Minimum Path SumGiven a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path.Note: You can o
2017-10-02 00:25:54 116
原创 Course Schedule
题目原网址为https://leetcode.com/problems/course-schedule/description/一.题目There are a total of n courses you have to take, labeled from 0 to n - 1.Some courses may have prerequisites, for
2017-09-22 19:40:23 146
原创 ZigZag Conversion
这是一道来自leetcode的题目,原题网址为https://leetcode.com/problems/zigzag-conversion/description/一、题目The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you ma
2017-09-15 00:00:08 143
原创 Add Two Numbers
一、概述最近在刷leetcode上的题,下面是我对Add Two Numbers这道题的解法,这道题的原网址为https://leetcode.com/problems/add-two-numbers/description/二、题目You are given two non-empty linked lists representing two non-negative in
2017-09-10 23:44:33 215
原创 Unity3d学习笔记(8)-- 可展开公告牌
模仿这个网站制造一个可展开的公告牌 http://www.tasharen.com/ngui/example9.html(PS:请用ie打开)一.首先上个最终的效果图:二.首先创建一个ScollView,然后在Content那里创建三个Button和Text,结果如下图所示:
2017-05-07 14:34:00 1225
原创 Unity3d学习笔记(7)--打靶游戏
一.游戏简介:这是一个简单的打靶游戏,总共有五环,从外到里依次是一到五环,打到一环得一分,二环得二分,依此类推玩家可以通过方向键或asdw键来控制发射的位置,还有,在游戏当中,还会有风来影响箭的飞行方向二.游戏效果图:三.UML图:四.游戏主要代码和设置说明:1.游戏中是用了虚拟轴来控制箭的位置,不过移动箭的代码是挂在一个空对
2017-04-04 09:06:21 954
原创 Unity3D学习笔记(6)-- 打飞碟游戏改进版
一.简要说明这是上一次打飞碟游戏的改进版本,这次和上次的版本有小些差异,在功能上主要添加了一个物理运动的模块,以下来讲讲这些改动。二.游戏效果图三.UML图先上一张UML图PhysicActionManager有点看不全,不过基本和CCActionManager相同四.主要代码说明1.这里用了两个工厂类来管理飞碟和控制飞碟运动的脚本的生成和回
2017-04-03 21:37:12 1289
原创 Unity3D学习笔记(5)-打飞碟游戏
游戏简介 这是一个简单的打飞碟游戏,总共有3个回合,每个回合都会出现N个颜色不同的飞碟,其中击中黄色飞碟得1分,击中红色飞碟得2分,击中黑色飞碟得四分,而且这个游戏是没有结束的,这三个回合不断的重复。游戏截图:游戏配置说明:游戏的摄像机设置如上游戏类图游戏源代码:一.飞碟回收工厂类(DiskFact
2017-03-27 11:01:53 1860 1
原创 Unity3D学习笔记(4)-牧师与魔鬼游戏改进
这次实现的还是恶魔与魔鬼游戏,不过在此基础上添加了一个动作管理器 把动作管理和游戏场景分离出来,上一个版本的链接在这里http://blog.csdn.net/x2_yt/article/details/61912680,有兴趣的朋友可以 去看看。 以下是整个文件的UML图:SSActionManager类是动作管理的基类,所有动作管理器都要继承于它CCActionManager是SSAc
2017-03-19 17:55:31 575
原创 Unity3d学习笔记(3)--牧师与魔鬼游戏
牧师与魔鬼游戏简介:一个牧师与魔鬼的游戏,3个牧师与3个魔鬼都在河的一边,他们都想要度过一条河,但是只有一条船而且这条船一次只能搭载两个人,而且每次都需要有一个人把船从河的一边划到另一边,你可以点击他们把它们移动,点击go按钮可以移动船到另一边,如果任一边魔鬼的数量多于牧师的数量,游戏就结束了。整个游戏的源代码在最下面,想要整个代码的可以在下面找首先,先上一张最终的结果
2017-03-13 09:12:56 1106
原创 Unity3d学习笔记(2)--一个太阳系的实现
这是实现一个简单的太阳系,包括太阳和八大行星和月亮。这个程序采用MVC结构 总共有6个cs文件: SSDirector.cs:控制场景的切换,指明哪个是当前场景 FristController.cs:控制第一个场景的资源加载和配置 roundsun.cs:挂载在太阳上的组件,使其它行星绕太阳转,月亮绕地球转和各天体的自转
2017-03-13 08:54:20 769
原创 Unity3D学习笔记1
下面是一个井字棋的源代码using System.Collections;using System.Collections.Generic;using UnityEngine;public class NewBehaviourScript : MonoBehaviour { int[,] Tic_Tac_Toe; int turn; int num;
2017-03-05 09:46:31 323
原创 QT的安装与使用笔记
以下在ubuntu 操作1.QT的安装: sudo apt-get install qt4-dev-tools 安装工具包 sudo apt-get install qt4-doc 帮助文档2.QT在的使用: 安装完QT后,可以用qmake -v查看是否安装好。
2016-08-31 23:13:52 240
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人