- 博客(19)
- 收藏
- 关注
原创 LeetCode刷题记录(第十六天)
Next Greater Element I原题目:You are given two arrays (without duplicates) nums1 and nums2 where nums1’s elements are subset of nums2. Find all the next greater numbers for nums1's elements in the corres...
2018-04-09 22:27:54
266
原创 LeetCode刷题记录(第十五天)
Reshape the Matrix原题目:In MATLAB, there is a very useful function called 'reshape', which can reshape a matrix into a new one with different size but keep its original data.You're given a matrix repres...
2018-04-04 23:42:33
796
原创 LeetCode刷题记录(第十四天)
Toeplitz Matrix原题目:A matrix is Toeplitz if every diagonal from top-left to bottom-right has the same element.Now given an M x N matrix, return True if and only if the matrix is Toeplitz.翻译:如果从左上角到右下角的...
2018-04-03 22:19:44
225
原创 LeetCode刷题记录(第十三天)
Island Perimeter原题目:You are given a map in form of a two-dimensional integer grid where 1 represents land and 0 represents water. Grid cells are connected horizontally/vertically (not diagonally). The...
2018-04-02 23:34:19
214
原创 LeetCode刷题记录(第十二天)
Distribute Candies原题目:Given an integer array with even length, where different numbers in this array represent different kinds of candies. Each number means one candy of the corresponding kind. You ne...
2018-04-01 22:04:54
182
原创 LeetCode刷题记录(第十一天)
Baseball Game原题目:You're now a baseball game point recorder.Given a list of strings, each string can be one of the 4 following types:Integer (one round's score): Directly represents the number of point...
2018-03-31 20:38:33
545
1
原创 LeetCode刷题记录(第十天)
Fizz Buzz原题目:Write a program that outputs the string representation of numbers from 1 to n.But for multiples of three it should output “Fizz” instead of the number and for the multiples of five output...
2018-03-30 23:15:32
196
原创 LeetCode刷题记录(第九天)
Keyboard Row原题目:Given a List of words, return the words that can be typed using letters of alphabet on only one row's of American keyboard like the image below.翻译后:给定一个单词列表,只返回可在美式键盘的一行上使用字母表输入的单词,如下图...
2018-03-29 23:52:28
176
原创 LeetCode刷题记录(第八天)
Reverse Words in a String III昨天是悲剧的一天,发烧加加班,天气热的太快了,唉。原题目:Given a string, you need to reverse the order of characters in each word within a sentence while still preserving whitespace and initial word ...
2018-03-28 20:02:31
190
原创 LeetCode刷题记录(第七天)
Number Complement原题目:Given a positive integer, output its complement number. The complement strategy is to flip the bits of its binary representation.Note:The given integer is guaranteed to fit within...
2018-03-26 23:13:51
141
原创 mongodb的安装与配置
mongodb的安装与配置在公司一直使用的是redis,对redis虽然不是非常精通,但还是会使用redis的,而且因为公司在用,以后肯定会越来越熟练的,所以现在也学一学mongodb,因为前几天有人问过我关于mongodb的东西,但是以前只是在学校的课程中学习过一点,都忘记了,所以再从头学一边,记好笔记。一、mongodb的好处:1、无数据结构的限制: 1)、没有表结构的概念,每条记录都可...
2018-03-26 19:52:37
147
原创 LeetCode刷题记录(第六天)
Swap Salary这道题竟然是一个sql题,虽然经常写sql和看关于mysql的性能优化,但是我发现一个大问题,我都白学来。。。。题目:Given a table salary, such as the one below, that has m=male and f=female values. Swap all f and m values (i.e., change all f valu...
2018-03-25 22:22:54
798
原创 LeetCode刷题记录(第六天)
Self Dividing Numbers关于昨天题目遗留的问题,原谅我还是没有学会,答案中给了四种方法,虽然意思都理解的差不多,但是答案的代码给的c++版,看完以后还是一脸懵逼,不知道昨天为什么出来一道难度hard的题目,我这种小白easy都吃力,竟然找死写一道只有37%人写出解决方案的难题。。。。不过确实是锻炼脑子,已经死了一半的脑细胞了。。。。今天美好的周六,在公司加了一天的班,晚上竟然还做...
2018-03-24 23:56:42
154
原创 LeetCode刷题记录(第五天)
Trapping Rain Water原题目:Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining.翻译后:给定n个非负整数来表示每个柱的宽度为1的高程图...
2018-03-23 23:52:14
554
原创 LeetCode刷题记录(第四天)
Reverse String原题目:Write a function that takes a string as input and returns the string reversed.这个直接我自己翻译了:写出一个方法输入一个字符串并且把它反着返回。(看来我英语还不错)事例:Example:Given s = "hello", return "olleh".思路:这个题还是非常简单的,主要...
2018-03-22 23:53:34
314
原创 LeetCode刷题记录(第三天)
Judge Route Circle原题目:Initially, there is a Robot at position (0, 0). Given a sequence of its moves, judge if this robot makes a circle, which means it moves back to the original place.The move sequen...
2018-03-21 23:42:25
219
原创 LeetCode刷题记录(第二天)
Hamming Distance原题目:The Hamming distance between two integers is the number of positions at which the corresponding bits are different.Given two integers x and y, calculate the Hamming distance.翻译后:两个...
2018-03-20 23:56:59
175
翻译 常用的正则表达式字符含义
\ 将下一个字符标记为一个特殊字符、或一个原义字符、或一个 向后引用、或一个八进制转义符。例如,'n' 匹配字符 "n"。'\n' 匹配一个换行符。序列 '\\' 匹配 "\" 而 "\(" 则匹配 "("。 ^ 匹配输入字符串的开始位置。如果设置了 RegExp 对象的 Multiline 属性,^ 也匹配 '\n' 或 '\r' 之后的位置。 $ 匹配输入字符串的结束...
2018-03-19 23:28:20
400
原创 LeetCode刷题记录(第一天)
Jewels and Stones原题目:You're given strings J representing the types of stones that are jewels, and S representing the stones you have. Each character in Sis a type of stone you have. You want to know...
2018-03-19 23:23:58
880
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人