摘要: Given an integer n. No-Zero integer is a positive integer which doesn't contain any 0 in its decimal representation. Return a list of two integers [A, 阅读全文
posted @ 2020-11-04 05:20 Sheanne 阅读(40) 评论(0) 推荐(0)
摘要: 这是labuladong的文章总结。 这是一题经典的DP问题,DP的框架为首先思考这个问题有什么状态,有哪些选择,最后根据情况穷举所有可行解。 这题的状态即为当前拥有的鸡蛋数k以及当前所在的楼层数n。选择是我们选择去哪一层楼扔鸡蛋。由状态和选择我们可以得到相对应的转移方程(因为有两个状态,鸡蛋数以及 阅读全文
posted @ 2020-02-01 10:51 Sheanne 阅读(272) 评论(0) 推荐(0)
摘要: Find the largest palindrome made from the product of two n-digit numbers. Since the result could be very large, you should return the largest palindro 阅读全文
posted @ 2020-02-01 10:12 Sheanne 阅读(128) 评论(0) 推荐(0)
摘要: In the computer world, use restricted resource you have to generate maximum benefit is what we always want to pursue. For now, suppose you are a domin 阅读全文
posted @ 2020-01-31 10:32 Sheanne 阅读(190) 评论(0) 推荐(0)
摘要: Remember the story of Little Match Girl? By now, you know exactly what matchsticks the little match girl has, please find out a way you can make one s 阅读全文
posted @ 2020-01-31 05:57 Sheanne 阅读(246) 评论(0) 推荐(0)
摘要: Given a list of words (without duplicates), please write a program that returns all concatenated words in the given list of words. A concatenated word 阅读全文
posted @ 2020-01-31 04:13 Sheanne 阅读(192) 评论(1) 推荐(0)
摘要: Given a function rand7 which generates a uniform random integer in the range 1 to 7, write a function rand10 which generates a uniform random integer 阅读全文
posted @ 2020-01-31 00:25 Sheanne 阅读(182) 评论(0) 推荐(0)
摘要: Given a list of points that form a polygon when joined sequentially, find if this polygon is convex (Convex polygon definition). 阅读全文
posted @ 2020-01-30 23:38 Sheanne 阅读(234) 评论(0) 推荐(0)
摘要: Consider the string s to be the infinite wraparound string of "abcdefghijklmnopqrstuvwxyz", so s will look like this: "...zabcdefghijklmnopqrstuvwxyza 阅读全文
posted @ 2020-01-30 04:22 Sheanne 阅读(158) 评论(0) 推荐(0)
摘要: Define S = [s,n] as the string S which consists of n connected strings s. For example, ["abc", 3] ="abcabcabc". On the other hand, we define that stri 阅读全文
posted @ 2020-01-30 03:29 Sheanne 阅读(140) 评论(0) 推荐(0)