关闭

[置顶] 推广一下新Blog www.hrwhisper.me

新博客地址:www.hrwhisper.me...
阅读(565) 评论(1)

leetcode Increasing Triplet Subsequence

leetcode Increasing Triplet Subsequence Given an unsorted array return whether an increasing subsequence of length 3 exists or not in the array. Formally the function should: Return true if t...
阅读(518) 评论(0)

leetcode Reconstruct Itinerary

leetcode Reconstruct Itinerary Given a list of airline tickets represented by pairs of departure and arrival airports [from, to], reconstruct the itinerary in order. All of the tickets belong to ...
阅读(2616) 评论(1)

leetcode Verify Preorder Serialization of a Binary Tree

One way to serialize a binary tree is to use pre-order traversal. When we encounter a non-null node, we record the node's value. If it is a null node, we record using a sentinel value such as #. ...
阅读(1574) 评论(0)

leetcode Patching Array

题意:给定一个数组nums和一个数n,求添加最少的数使得[1,n]中的每个数都可以由数组中元素和组成用known_sum表示已知的连续和为[1,known_sum),有了这个表示那就简单了: nums[i] nums[i] >  known_sum,  添加known_sum进数组才能达到最大的范围,所以已知范围更新为:[1,known_sum *2  ) ...
阅读(1354) 评论(0)

leetcode Longest Increasing Path in a Matrix

题意:给定一个矩阵,在里面找出最大上升路径 int dx[] = { 1 , -1, 0 , 0 }; int dy[] = { 0 , 0 , 1 , -1 }; class Solution { public: int dfs(int x, int y, const int &m,const int &n,vector>& matrix, vector>& dis) { if (di...
阅读(1016) 评论(0)

leetcode Odd Even Linked List

Given a singly linked list, group all odd nodes together followed by the even nodes. Please note here we are talking about the node number and not the value in the nodes. You should try to do it in...
阅读(394) 评论(0)

leetcode Count of Range Sum

Given an integer array nums, return the number of range sums that lie in [lower, upper] inclusive. Range sum S(i, j) is defined as the sum of the elements in nums between indices i and j (i ≤ j),...
阅读(2759) 评论(0)

leetcode Power of Three

Given an integer, write a function to determine if it is a power of three. Follow up: Could you do it without using any loop / recursion? 方法一: class Solution { public: bool isPowerOfTh...
阅读(1162) 评论(0)

leetcode Wiggle Sort II

Given an unsorted array nums, reorder it such that nums[0] nums[2] . Example: (1) Given nums = [1, 5, 1, 1, 6, 4], one possible answer is [1, 4, 1, 5, 1, 6].  (2) Given nums = [1, 3, 2, 2, 3...
阅读(2448) 评论(0)

leetcode Coin Change

You are given coins of different denominations and a total amount of money amount. Write a function to compute the fewest number of coins that you need to make up that amount. If that amount of money...
阅读(2350) 评论(0)

leetcode Create Maximum Number

Given two arrays of length m and n with digits 0-9 representing two numbers. Create the maximum number of length k  from digits of the two. The relative order of the digits from the same array mus...
阅读(1890) 评论(0)

leetcode Bulb Switcher

leetcode Bulb Switcher 题解 http://www.hrwhisper.me/leetcode-bulb-switcher/...
阅读(499) 评论(0)

leetcode Maximum Product of Word Lengths

Given a string array words, find the maximum value of length(word[i]) * length(word[j]) where the two words do not share common letters. You may assume that each word will contain only lower case le...
阅读(483) 评论(0)

leetcode Remove Duplicate Letters

Given a string which contains only lowercase letters, remove duplicate letters so that every letter appear once and only once. You must make sure your result is the smallest in lexicographical order a...
阅读(1169) 评论(0)

leetcode Count of Smaller Numbers After Self

You are given an integer array nums and you have to return a new counts array. The counts array has the property where counts[i] is the number of smaller elements to the right of nums[i]. Example...
阅读(2110) 评论(0)
352条 共24页1 2 3 4 5 ... 下一页 尾页
    My way and My heart:)
    个人资料
    • 访问:359210次
    • 积分:7511
    • 等级:
    • 排名:第3187名
    • 原创:325篇
    • 转载:27篇
    • 译文:0篇
    • 评论:85条
    博客专栏
    友情链接