上一页 1 2 3 4 5 6 ··· 41 下一页
摘要: 思路:动态规划。对于第i行第j列的元素grid[i][j]表示的是这个元素的plus sign的等级,初始化不在mines中的元素对应的grid值为较大值(只要大于N/2即可),在mines中的元素对应的grid值为0。不在mines中的元素,其grid[i][j]=左右上下四个方向最少的连续1的个 阅读全文
posted @ 2018-01-15 20:57 Deribs4 阅读(1360) 评论(0) 推荐(0) 编辑
摘要: 思路:动态规划。注意1024*1024>10^6,所以质素范围是(0,23)。 阅读全文
posted @ 2018-01-14 22:56 Deribs4 阅读(215) 评论(0) 推荐(0) 编辑
摘要: Next challenges: Android Unlock Patterns Maximum XOR of Two Numbers in an Array Maximum Vacation Days 思路:动态规划。 两种分解方法: count[i]表示的是i的二进制表示中1的个数。 1.cou 阅读全文
posted @ 2018-01-14 22:43 Deribs4 阅读(101) 评论(0) 推荐(0) 编辑
摘要: A message containing letters from A-Z is being encoded to numbers using the following mapping: Given an encoded message containing digits, determine t 阅读全文
posted @ 2017-07-30 17:25 Deribs4 阅读(137) 评论(0) 推荐(0) 编辑
摘要: Given a string s, find the longest palindromic subsequence's length in s. You may assume that the maximum length of s is 1000. Example 1:Input: Output 阅读全文
posted @ 2017-07-26 09:13 Deribs4 阅读(154) 评论(0) 推荐(0) 编辑
摘要: Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000. Example: Example: Similar Question 阅读全文
posted @ 2017-07-25 13:25 Deribs4 阅读(173) 评论(0) 推荐(0) 编辑
摘要: Given a string, your task is to count how many palindromic substrings in this string. The substrings with different start indexes or end indexes are c 阅读全文
posted @ 2017-07-24 14:30 Deribs4 阅读(1742) 评论(0) 推荐(0) 编辑
摘要: Compare two version numbers version1 and version2.If version1 > version2 return 1, if version1 < version2 return -1, otherwise return 0. You may assum 阅读全文
posted @ 2017-07-23 10:49 Deribs4 阅读(149) 评论(0) 推荐(0) 编辑
摘要: Given a word, you need to judge whether the usage of capitals in it is right or not. We define the usage of capitals in a word to be right when one of 阅读全文
posted @ 2017-07-22 14:44 Deribs4 阅读(148) 评论(0) 推荐(0) 编辑
摘要: Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. For example,"A man, a plan, a canal: Pan 阅读全文
posted @ 2017-07-22 14:18 Deribs4 阅读(129) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 41 下一页