自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(11)
  • 资源 (1)
  • 收藏
  • 关注

原创 [leetcode] 383. Ransom Note 解题报告

题目链接: https://leetcode.com/problems/ransom-note/
Given
 an 
arbitrary
 ransom
 note
 string 
and 
another 
string 
containing 
letters from
 all 
the 
magazines,
 write 
a 
function 
that 
will

2016-08-29 14:16:21 1540

原创 [leetcode] 389. Find the Difference 解题报告

题目链接: https://leetcode.com/problems/find-the-difference/Given two strings s and t which consist of only lowercase letters.String t is generated by random shuffling string s and then add one

2016-08-29 14:10:50 3002

原创 [google interview] 输出所有的整数

给一个数字集合,数字是0-9,没有重复,输出由其中的数字构成的所有整数,该整数小于某一个特定的整数比如:数字集合[1,2,3], 特定整数130。 输出: 1,2,3, 11,12,13,21,22,23,31,32,33, 111,112,113,121,122,123. (下一个数字131 > 130), 输出的顺序无所谓。思路: 每一位遍历所有的数字, 如果大于target就

2016-08-29 05:30:51 630

原创 统计字符流中一个字符串出现的次数- KMP算法

这是google onsite的一个题目, 说是一个无限的0/1字符串流, 给定一个字符串如"110010", 求到当前为止, 在字符流中出现了多少次这种字符.一开始想到dp来做, 然后画了一下转移方程感觉不对, 然后又感觉越看越像是KMP, 仔细分析可以发现, 其思路就是求当前字符流的后缀与给定的字符串相等即可. 按照正常的思路即取与给定字符串长度相等的字符串, 比较是否相等即可, 这种方式

2016-08-28 07:10:21 2666

原创 [leetcode] 379. Design Phone Directory 解题报告

题目链接: https://leetcode.com/problems/design-phone-directory/Design a Phone Directory which supports the following operations:get: Provide a number which is not assigned to anyone.check: C

2016-08-25 06:25:05 3391

原创 [leetcode] 387. First Unique Character in a String 解题报告

题目链接:https://leetcode.com/problems/first-unique-character-in-a-string/Given a string, find the first non-repeating character in it and return it's index. If it doesn't exist, return -1.Examp

2016-08-25 02:09:38 2586

原创 [leetcode] 388. Longest Absolute File Path 解题报告

题目链接: https://leetcode.com/problems/longest-absolute-file-path/Suppose we abstract our file system by a string in the following manner:The string "dir\n\tsubdir1\n\tsubdir2\n\t\tfile.ext" re

2016-08-24 08:53:58 6641

原创 [leetcode] 384. Shuffle an Array 解题报告

题目链接: https://leetcode.com/problems/shuffle-an-array/Shuffle a set of numbers without duplicates.Example:// Init an array with set 1, 2, and 3.int[] nums = {1,2,3};Solution solution = ne

2016-08-24 00:12:10 3712

原创 [leetcode] 380. Insert Delete GetRandom O(1) 解题报告

题目链接: https://leetcode.com/problems/insert-delete-getrandom-o1/Design a data structure that supports all following operations in average O(1) time.insert(val): Inserts an item val to the

2016-08-21 04:43:04 3692

原创 [leetcode] 378. Kth Smallest Element in a Sorted Matrix 解题报告

题目链接: https://leetcode.com/problems/kth-smallest-element-in-a-sorted-matrix/Given a n x n matrix where each of the rows and columns are sorted in ascending order, find the kth smallest element i

2016-08-20 15:43:59 4411 1

原创 [leetcode] 382. Linked List Random Node 解题报告

题目链接: https://leetcode.com/problems/linked-list-random-node/Given a singly linked list, return a random node's value from the linked list. Each node must have the same probability of being chose

2016-08-12 04:45:46 4746

qt3扫雷代码

本程序制作精心,代码完整,为10*10大小的雷区,等级分为三级,简单,中等,困难。其中布雷使用随机数生成,扫空格使用广度搜索BFS,基本具备了扫雷的应有的功能。界面友善,希望能对你有帮助。

2013-11-15

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除