随笔分类 -  LeetCode

摘要:Assume you are an awesome parent and want to give your children some cookies. But, you should give each child at most one cookie. Each child i has a g 阅读全文
posted @ 2017-09-12 14:23 Yancea 阅读(131) 评论(0) 推荐(0)
摘要:Given an arbitrary ransom note string and another string containing letters from all the magazines, write a function that will return true if the rans 阅读全文
posted @ 2017-09-12 10:54 Yancea 阅读(157) 评论(0) 推荐(0)
摘要: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 values to m and vice ver 阅读全文
posted @ 2017-09-11 22:38 Yancea 阅读(152) 评论(0) 推荐(0)
摘要:Given an array of 2n integers, your task is to group these integers into n pairs of integer, say (a1, b1), (a2, b2), ..., (an, bn) which makes sum of 阅读全文
posted @ 2017-09-11 22:34 Yancea 阅读(131) 评论(0) 推荐(0)
摘要:Given two binary trees and imagine that when you put one of them to cover the other, some nodes of the two trees are overlapped while the others are n 阅读全文
posted @ 2017-09-11 22:29 Yancea 阅读(133) 评论(0) 推荐(0)
摘要:The Hamming distance between two integers is the number of positions at which the corresponding bits are different. Given two integers x and y, calcul 阅读全文
posted @ 2017-09-11 22:24 Yancea 阅读(107) 评论(0) 推荐(0)
摘要:There is a table World A country is big if it has an area of bigger than 3 million square km or a population of more than 25 million. Write a SQL solu 阅读全文
posted @ 2017-09-11 22:21 Yancea 阅读(118) 评论(0) 推荐(0)
摘要: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 might 阅读全文
posted @ 2017-09-11 19:57 Yancea 阅读(108) 评论(0) 推荐(0)
摘要:Given a positive integer, return its corresponding column title as appear in an Excel sheet. For example: 阅读全文
posted @ 2017-09-11 19:03 Yancea 阅读(131) 评论(0) 推荐(0)
摘要:Given a column title as appear in an Excel sheet, return its corresponding column number. For example: 相关问题:http://www.cnblogs.com/yancea/p/7506456.ht 阅读全文
posted @ 2017-09-11 12:20 Yancea 阅读(104) 评论(0) 推荐(0)
摘要:Given two arrays, write a function to compute their intersection. Example:Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return [2]. Note: Each element i 阅读全文
posted @ 2017-09-08 16:36 Yancea 阅读(110) 评论(0) 推荐(0)
摘要:Given a non-empty integer array of size n, find the minimum number of moves required to make all array elements equal, where a move is incrementing n  阅读全文
posted @ 2017-09-08 16:06 Yancea 阅读(107) 评论(0) 推荐(0)
摘要: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 or 阅读全文
posted @ 2017-09-08 15:18 Yancea 阅读(177) 评论(0) 推荐(0)