随笔分类 -  dp - backpack

322. Coin Change
摘要:322. Coin Change You are given coins of different denominations and a total amount of money amount. Write a function to compute the fewest number of c 阅读全文

posted @ 2018-11-06 07:59 猪猪🐷

518. Coin Change 2
摘要:518. Coin Change 2 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 amount. You may assume that you... 阅读全文

posted @ 2018-11-06 07:58 猪猪🐷

494. Target Sum
摘要:You are given a list of non-negative integers, a1, a2, ..., an, and a target, S. Now you have 2 symbols + and -. For each integer, you should choose o 阅读全文

posted @ 2018-11-06 07:55 猪猪🐷

474. Ones and Zeroes
摘要: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 dominator of m 0s and n 1s respectively. On the other ... 阅读全文

posted @ 2018-11-06 07:54 猪猪🐷

416 Partition Equal Subset Sum
摘要:Given a non-empty array containing only positive integers, find if the array can be partitioned into two subsets such that the sum of elements in both subsets is equal. Note: 1. Each of the array el... 阅读全文

posted @ 2018-11-06 07:53 猪猪🐷

377. Combination Sum IV
摘要:377. Combination Sum IV Given an integer array with all positive numbers and no duplicates, find the number of possible combinations that add up to a positive integer target. Example: nums = [1, 2, ... 阅读全文

posted @ 2018-08-11 03:40 猪猪🐷

494. Target Sum
摘要:494. Target Sum You are given a list of non-negative integers, a1, a2, ..., an, and a target, S. Now you have 2 symbols + and -. For each integer, you should choose one from + and - as its new symbol... 阅读全文

posted @ 2018-08-09 18:41 猪猪🐷

导航