2017年9月11日

LeetCode: 383 Ransom Note(easy)

摘要: 题目: Given an arbitrary ransom note string and another string containing letters from all the magazines, write a function that will return true if the 阅读全文

posted @ 2017-09-11 20:55 玲珑子 阅读(81) 评论(0) 推荐(0) 编辑

2017年9月9日

LeetCode: 171 Excel Sheet Column Number(easy)

摘要: 题目: Related to question Excel Sheet Column Title Given a column title as appear in an Excel sheet, return its corresponding column number. For example 阅读全文

posted @ 2017-09-09 17:15 玲珑子 阅读(84) 评论(0) 推荐(0) 编辑

2017年9月6日

LeetCode: 598 Range Addition II(easy)

摘要: 题目: Given an m * n matrix M initialized with all 0's and several update operations. Operations are represented by a 2D array, and each operation is re 阅读全文

posted @ 2017-09-06 10:43 玲珑子 阅读(252) 评论(0) 推荐(0) 编辑

LeetCode: 492 Construct the Rectangle(easy)

摘要: 题目: or a web developer, it is very important to know how to design a web page's size. So, given a specific rectangular web page’s area, your job by no 阅读全文

posted @ 2017-09-06 10:26 玲珑子 阅读(121) 评论(0) 推荐(0) 编辑

2017年9月5日

LeetCode: 283 Move Zeroes(easy)

摘要: 题目: Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero elements. For example, 阅读全文

posted @ 2017-09-05 21:54 玲珑子 阅读(135) 评论(0) 推荐(0) 编辑

LeetCode: 389 Find the Difference(easy)

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

posted @ 2017-09-05 11:14 玲珑子 阅读(135) 评论(0) 推荐(0) 编辑

LeetCode: 669 Trim a Binary Search Tree(easy)

摘要: 题目: Given a binary search tree and the lowest and highest boundaries as L and R, trim the tree so that all its elements lies in [L, R] (R >= L). You m 阅读全文

posted @ 2017-09-05 10:57 玲珑子 阅读(187) 评论(0) 推荐(0) 编辑

2017年9月4日

C++: 内联函数

摘要: 转自:http://www.cnblogs.com/singa/archive/2008/09/24/1297821.html (1)什么是内联函数?内联函数是指那些定义在类体内的成员函数,即该函数的函数体放在类体内。(2)为什么要引入内联函数?当然,引入内联函数的主要目的是:解决程序中函数调用的效 阅读全文

posted @ 2017-09-04 22:06 玲珑子 阅读(152) 评论(0) 推荐(0) 编辑

C++: STL迭代器及迭代器失效问题

摘要: 转载至:http://blog.csdn.net/wangshihui512/article/details/9791517 迭代器失效: 典型的迭代器失效. 首先对于vector而言,添加和删除操作可能使容器的部分或者全部迭代器失效。那为什么迭代器会失效呢?vector元素在内存中是顺序存储,试想 阅读全文

posted @ 2017-09-04 09:46 玲珑子 阅读(3114) 评论(0) 推荐(0) 编辑

2017年8月31日

LeetCode: 371 Sum of Two Integers(easy)

摘要: 题目: Calculate the sum of two integers a and b, but you are not allowed to use the operator + and -. Example:Given a = 1 and b = 2, return 3. 代码: 使用移位来 阅读全文

posted @ 2017-08-31 10:40 玲珑子 阅读(77) 评论(0) 推荐(0) 编辑

导航