- 博客(8)
- 收藏
- 关注
原创 Leetcode-403.Frog Jump(青蛙跳石头)
今天的题目是:Leetcode 403-青蛙跳A frog is crossing a river. The river is divided into x units and at each unit there may or may not exist a stone. The frog can jump on a stone, but it must not jump into
2016-11-15 20:05:31 4288
原创 Leetcode-32. Longest Valid Parentheses
题目:Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring.For "(()", the longest valid parentheses subs
2016-11-13 22:37:30 489
原创 Leetcode-264. Ugly Number II
题目:代码:版本1:class Solution1 {public: int nthUglyNumber(int n) { vectornum = {2,3,5}; vectorre; re.push_back(0); //少于6个数 for (int i = 0; i < 6; i++)re.push_back(1); if (n <= 6
2016-11-12 14:59:52 463
原创 Leetcode-279. Perfect Squares
今天广州天气有点冷,如下图:so,刷个题暖暖身吧!!看题:279. Perfect Squares QuestionEditorial Solution My SubmissionsTotal Accepted: 56296Total Submissions: 163333Difficulty: MediumCon
2016-11-10 16:40:39 646
原创 Leetcode-312. Burst Balloons
题目:312. Burst Balloons Given n balloons, indexed from 0 to n-1. Each balloon is painted with a number on it represented by array nums. You are asked to burst all the balloons. If t
2016-11-09 22:36:27 500
原创 双重二分查找的应用
前几天面试的时候遇到一个问题,给定n个ip地址和m个ip地址块,如何判断,这n个地址是否在这m个ip地址块中的任意一个中。后来想到了一个双重二分查找的方法,思路如下:以IPv4地址为例,一共32位,为了方便记忆采用点分10进制方法标识。其本质是32位无符号整形,每一位不是0就是1,这样用来标记2^32-1个不同的unsigned型整数,每一个数代表一个网络地址。所以,对于一个给定的
2016-11-06 20:39:16 934
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人