![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法
文章平均质量分 80
旭小白灬
这个作者很懒,什么都没留下…
展开
-
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 · 227 阅读 · 0 评论 -
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 · 149 阅读 · 0 评论 -
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 · 181 阅读 · 0 评论 -
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 · 188 阅读 · 0 评论 -
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 · 223 阅读 · 0 评论 -
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 · 161 阅读 · 0 评论 -
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 · 120 阅读 · 0 评论 -
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 · 176 阅读 · 0 评论 -
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 · 472 阅读 · 2 评论 -
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 · 715 阅读 · 0 评论 -
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 · 156 阅读 · 0 评论 -
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 · 145 阅读 · 0 评论 -
LeetCode刷题记录(第六天)
Self Dividing Numbers关于昨天题目遗留的问题,原谅我还是没有学会,答案中给了四种方法,虽然意思都理解的差不多,但是答案的代码给的c++版,看完以后还是一脸懵逼,不知道昨天为什么出来一道难度hard的题目,我这种小白easy都吃力,竟然找死写一道只有37%人写出解决方案的难题。。。。不过确实是锻炼脑子,已经死了一半的脑细胞了。。。。今天美好的周六,在公司加了一天的班,晚上竟然还做...原创 2018-03-24 23:56:42 · 131 阅读 · 0 评论 -
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 · 142 阅读 · 0 评论 -
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 · 500 阅读 · 0 评论 -
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 · 806 阅读 · 1 评论 -
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 · 696 阅读 · 0 评论