- 博客(4)
- 资源 (3)
- 收藏
- 关注
原创 Rotate Image
You are given an n x n 2D matrix representing an image. Rotate the image by 90 degrees (clockwise). Follow up: Could you do this in-place? 本题为原地算法,只需要一个额外的变量作为存储转移矩阵时的临时空间,分就两种情况,代码如下:
2015-01-26 10:48:00 315
原创 Two Sum
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, whe
2015-01-24 19:23:55 374
原创 leetcode:Longest Substring Without Repeating Characters (寻找最长无重复字符的子串)
题目: Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters for "abcabcbb" is "abc", which the length is
2014-03-13 19:06:56 619
原创 字符串匹配(北航08机试)
题目描述: 读入数据string[ ],然后读入一个短字符串。要求查找string[ ]中和短字符串的所有匹配,输出行号、匹配字符串。匹配时不区分大小写,并且可以有一个用中括号表示的模式匹配。如“aa[123]bb”,就是说aa1bb、aa2bb、aa3bb都算匹配。 输入: 输入有多组数据。 每组数据第一行输入n(1 输出: 输出匹配到的字符串的行
2014-03-12 17:05:52 680
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人