Fork me on GitHub
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 37 下一页
摘要: Given a binary tree, find the length of the longest path where each node in the path has the same value. This path may or may not pass through the roo 阅读全文
posted @ 2017-10-07 23:06 hellowOOOrld 阅读(519) 评论(0) 推荐(0) 编辑
摘要: Given two strings A and B, find the minimum number of times A has to be repeated such that B is a substring of it. If no such solution, return -1. For 阅读全文
posted @ 2017-10-07 18:24 hellowOOOrld 阅读(454) 评论(0) 推荐(0) 编辑
摘要: 田忌赛马,大致题意是田忌和国王赛马,赢一局得200元,输一局输掉200元,平局则财产不动。 先输入一个整数N,接下来一行是田忌的N匹马,下一行是国王的N匹马。当N为0时结束。 此题为贪心算法解答,有两种思路。 思路二: 1、开始也是先排序,可以使用sort快排; 2、然后将田忌最大的马与国王进行比较 阅读全文
posted @ 2017-09-27 15:30 hellowOOOrld 阅读(3628) 评论(0) 推荐(1) 编辑
摘要: Given a 2D matrix matrix, find the sum of the elements inside the rectangle defined by its upper left corner (row1, col1) and lower right corner (row2 阅读全文
posted @ 2017-09-24 16:14 hellowOOOrld 阅读(214) 评论(0) 推荐(0) 编辑
摘要: You're now a baseball game point recorder. Given a list of strings, each string can be one of the 4 following types: Each round's operation is permane 阅读全文
posted @ 2017-09-24 10:59 hellowOOOrld 阅读(151) 评论(0) 推荐(0) 编辑
摘要: You are playing the following Bulls and Cows game with your friend: You write down a number and ask your friend to guess what the number is. Each time 阅读全文
posted @ 2017-09-22 10:00 hellowOOOrld 阅读(277) 评论(1) 推荐(0) 编辑
摘要: There are n bulbs that are initially off. You first turn on all the bulbs. Then, you turn off every second bulb. On the third round, you toggle every 阅读全文
posted @ 2017-09-21 20:35 hellowOOOrld 阅读(196) 评论(0) 推荐(0) 编辑
摘要: Given a non-empty string s, you may delete at most one character. Judge whether you can make it a palindrome. Example 1: Input: "aba" Output: True Exa 阅读全文
posted @ 2017-09-20 17:28 hellowOOOrld 阅读(211) 评论(0) 推荐(0) 编辑
摘要: Implement a magic directory with buildDict, and search methods. For the method buildDict, you'll be given a list of non-repetitive words to build a di 阅读全文
posted @ 2017-09-10 11:38 hellowOOOrld 阅读(192) 评论(0) 推荐(0) 编辑
摘要: Given an unsorted array of integers, find the length of longest continuous increasing subsequence. Example 1: Example 2: Note: Length of the array wil 阅读全文
posted @ 2017-09-10 11:28 hellowOOOrld 阅读(345) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 37 下一页