Fork me on GitHub
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 37 下一页
摘要: Given n non-negative integers representing the histogram's bar height where the width of each bar is 1, find the area of largest rectangle in the hist 阅读全文
posted @ 2017-09-04 14:23 hellowOOOrld 阅读(159) 评论(0) 推荐(0)
摘要: Given a non-negative integer, you could swap two digits at most once to get the maximum valued number. Return the maximum valued number you could get. 阅读全文
posted @ 2017-09-03 12:40 hellowOOOrld 阅读(691) 评论(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-03 11:54 hellowOOOrld 阅读(530) 评论(0) 推荐(0)
摘要: Given a non-empty special binary tree consisting of nodes with the non-negative value, where each node in this tree has exactly two or zero sub-node. 阅读全文
posted @ 2017-09-03 11:32 hellowOOOrld 阅读(280) 评论(0) 推荐(0)
摘要: Given two integers n and k, you need to construct a list which contains n different positive integers ranging from 1 to n and obeys the following requ 阅读全文
posted @ 2017-09-01 22:27 hellowOOOrld 阅读(301) 评论(0) 推荐(0)
摘要: 题意大概是给定M×N的棋盘格,从左上到右下,只能向右或者向下走,每走一步需要加上棋盘格子内的数值(有正有负)。 需要随时保证当前的数值>=1。问初始需要最少的值是多少? 思路: 动态规划。用dp[i][j]代表当前最大的数值。首先求出dp[m][n],得出到达右下角的最优值。 然后再回溯求出从左上角 阅读全文
posted @ 2017-08-27 22:27 hellowOOOrld 阅读(743) 评论(1) 推荐(0)
摘要: If the depth of a tree is smaller than 5, then this tree can be represented by a list of three-digits integers. For each integer in this list: Given a 阅读全文
posted @ 2017-08-27 12:55 hellowOOOrld 阅读(572) 评论(0) 推荐(0)
摘要: Given an array with n integers, your task is to check if it could become non-decreasing by modifying at most 1 element. We define an array is non-decr 阅读全文
posted @ 2017-08-27 11:33 hellowOOOrld 阅读(582) 评论(0) 推荐(0)
摘要: Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element. For exam 阅读全文
posted @ 2017-08-26 17:28 hellowOOOrld 阅读(167) 评论(0) 推荐(0)
摘要: 给定一个字符串S和有效单词的字典D,请确定可以插入到S中的最小空格数,使得最终的字符串完全由D中的有效单词组成。并输出解。 如果没有解则应该输出n/a 例如: 输入: S = “ilikealibaba” D = {"i","like","ali","liba","baba","alibaba"} 阅读全文
posted @ 2017-08-25 22:16 hellowOOOrld 阅读(362) 评论(0) 推荐(0)
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 37 下一页