摘要:Median is the middle value in an ordered integer list. If the size of the list is even, there is no middle value. So the median is the mean of the two 阅读全文
posted @ 2019-12-09 08:40 lz87 阅读 (30) 评论 (2) 编辑
摘要:Median is the middle value in an ordered integer list. If the size of the list is even, there is no middle value. So the median is the mean of the two 阅读全文
posted @ 2019-12-09 08:23 lz87 阅读 (17) 评论 (0) 编辑
摘要:You are given coins of different denominations and a total amount of money. Write a function to compute the number of combinations that make up that a 阅读全文
posted @ 2019-12-05 01:24 lz87 阅读 (15) 评论 (0) 编辑
摘要:Given a linear equation of n variables, find the total number of non-negative integer solutions of it. All coefficients are positive. Example: input: 阅读全文
posted @ 2019-12-04 23:58 lz87 阅读 (11) 评论 (0) 编辑
摘要:You are given a series of arithmetic equations as a string, such as: The equations use addition only and are separated by newlines. Return a mapping o 阅读全文
posted @ 2019-12-04 12:19 lz87 阅读 (12) 评论 (0) 编辑
摘要:(This problem is an interactive problem.) On the sea represented by a cartesian plane, each ship is located at an integer point, and each integer poin 阅读全文
posted @ 2019-12-03 00:38 lz87 阅读 (69) 评论 (0) 编辑
摘要:A quack is a data structure combining properties of both stacks and queues. It can be viewed as a list of elements written left to right such that thr 阅读全文
posted @ 2019-11-29 01:43 lz87 阅读 (59) 评论 (0) 编辑
摘要:A strobogrammatic number is a number that looks the same when rotated 180 degrees (looked at upside down). Write a function to count the total strobog 阅读全文
posted @ 2019-11-24 02:41 lz87 阅读 (13) 评论 (0) 编辑
摘要:A strobogrammatic number is a number that looks the same when rotated 180 degrees (looked at upside down). Find all strobogrammatic numbers that are o 阅读全文
posted @ 2019-11-24 02:38 lz87 阅读 (18) 评论 (0) 编辑
摘要:Dynamic programming solution State: dp[i]: the minimum cost to cover all positions from[0, i]. (left shift by 1 to get 0 index) // if position i is al 阅读全文
posted @ 2019-11-18 08:53 lz87 阅读 (121) 评论 (0) 编辑