2017年8月24日

LeetCode: 496 Next Greater Element I(easy)

摘要: 题目: 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 nu 阅读全文

posted @ 2017-08-24 09:40 玲珑子 阅读(121) 评论(0) 推荐(0) 编辑

LeetCode: 463 Island Perimeter(easy)

摘要: 题目: 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 horizontall 阅读全文

posted @ 2017-08-24 08:59 玲珑子 阅读(144) 评论(0) 推荐(0) 编辑

2017年8月23日

LeetCode: 620 Not Boring Movies(easy)

摘要: 题目: X city opened a new cinema, many people would like to go to this cinema. The cinema also gives out a poster indicating the movies’ ratings and des 阅读全文

posted @ 2017-08-23 15:11 玲珑子 阅读(317) 评论(0) 推荐(0) 编辑

C++: 其他类型转string

摘要: 1.to_string函数 C++11新增的函数,c++11标准增加了全局函数std::to_string,以及std::stoi/stol/stoll等等函数(string转int,long,以及long long) string to_string (int val);string to_str 阅读全文

posted @ 2017-08-23 14:50 玲珑子 阅读(624) 评论(0) 推荐(0) 编辑

LeetCode: 412 Fizz Buzz(easy)

摘要: 题目: 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 n 阅读全文

posted @ 2017-08-23 14:45 玲珑子 阅读(127) 评论(0) 推荐(0) 编辑

LeetCode: 344 Reverse String

摘要: 题目: Write a function that takes a string as input and returns the string reversed. Example:Given s = "hello", return "olleh". 代码: 自己的: 1 class Solutio 阅读全文

posted @ 2017-08-23 11:24 玲珑子 阅读(116) 评论(0) 推荐(0) 编辑

2017年8月22日

LeetCode: 566 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 d 阅读全文

posted @ 2017-08-22 20:11 玲珑子 阅读(146) 评论(0) 推荐(0) 编辑

2017年8月21日

LeetCode: 575 Distribute Candies(easy)

摘要: 题目: Given an integer array with even length, where different numbers in this array represent different kinds of candies. Each number means one candy o 阅读全文

posted @ 2017-08-21 16:47 玲珑子 阅读(108) 评论(0) 推荐(0) 编辑

LeetCode: 557Reverse Words in a String III(easy)

摘要: 题目: Given a string, you need to reverse the order of characters in each word within a sentence while still preserving whitespace and initial word orde 阅读全文

posted @ 2017-08-21 15:53 玲珑子 阅读(108) 评论(0) 推荐(0) 编辑

LeetCode: 500 Keyboard Row (easy)

摘要: 题目: 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. E 阅读全文

posted @ 2017-08-21 15:19 玲珑子 阅读(156) 评论(0) 推荐(0) 编辑

导航