tag:blogger.com,1999:blog-2597841815280998418.post6201336924473563759..comments2024-03-12T06:45:01.935+01:00Comments on This Thread: Partitioning SouvenirsMannyhttp://www.blogger.com/profile/07393063644320426727noreply@blogger.comBlogger11125tag:blogger.com,1999:blog-2597841815280998418.post-41694221758315227072020-05-19T10:20:33.814+02:002020-05-19T10:20:33.814+02:00Hi @Manny , can you explain with an example (b). I...Hi @Manny , can you explain with an example (b). I am not able to understandShonehttps://www.blogger.com/profile/14164238049646093540noreply@blogger.comtag:blogger.com,1999:blog-2597841815280998418.post-79989603988192675302018-08-17T12:01:44.107+02:002018-08-17T12:01:44.107+02:00Thank you for your question. Please, also have a l...Thank you for your question. Please, also have a look at the comment above from Shuai Zhao for a warning on this solution, that I patched and discussed in <a href="http://thisthread.blogspot.com/2018/06/partitioning-souvenirs-patched.html" rel="nofollow">this other post</a>.<br />I guess you are asking what means "2" in the table, right? As you could see in line #2, each cell is Mannyhttps://www.blogger.com/profile/07393063644320426727noreply@blogger.comtag:blogger.com,1999:blog-2597841815280998418.post-5922118464266311342018-08-11T05:38:23.472+02:002018-08-11T05:38:23.472+02:00Hi, first of all, thanks for ur solution and it he...Hi, first of all, thanks for ur solution and it helps me a lot. However, there is a question I wanna ask: What does "2" really means in this solution?<br />thxAnonymoushttps://www.blogger.com/profile/02808610529162701620noreply@blogger.comtag:blogger.com,1999:blog-2597841815280998418.post-59307791263463678222018-06-22T09:29:29.418+02:002018-06-22T09:29:29.418+02:00I have patched the code following the spark of kee...I have patched the code following the spark of keeping track of taken items. The resulting code is on GitHub and it is described in <a href="http://thisthread.blogspot.com/2018/06/partitioning-souvenirs-patched.html" rel="nofollow">this other post</a>.Mannyhttps://www.blogger.com/profile/07393063644320426727noreply@blogger.comtag:blogger.com,1999:blog-2597841815280998418.post-17883317111862310432018-06-19T13:08:03.600+02:002018-06-19T13:08:03.600+02:00Thank you for you useful comment, Shuai. You are r...Thank you for you useful comment, Shuai. You are right, my solution is not correct. Your test case shows how I forgot to consider that we should ensure an element is not used more than once to generate a sum. I wonder if I could save this algorithm keeping track if an element is free or already taken. Or, do you have a better idea?Mannyhttps://www.blogger.com/profile/07393063644320426727noreply@blogger.comtag:blogger.com,1999:blog-2597841815280998418.post-81710182127127711382018-06-18T05:12:59.656+02:002018-06-18T05:12:59.656+02:00the cell (2, {7,2,2}) is 2, the cell (4, {7,2,2}) ...the cell (2, {7,2,2}) is 2, the cell (4, {7,2,2}) is 1, so the code get cell (4, {7,2,2,2}) is 2, but it should be 1. Anonymoushttps://www.blogger.com/profile/11820461832448641405noreply@blogger.comtag:blogger.com,1999:blog-2597841815280998418.post-90571156564957650482018-06-18T05:10:23.723+02:002018-06-18T05:10:23.723+02:00Thx for your solution!
When I try to solve this pr...Thx for your solution!<br />When I try to solve this problem<br />https://leetcode.com/problems/partition-to-k-equal-sum-subsets/description/<br />I find a wrong case [7, 2, 2, 2, 2, 2, 2, 2, 3]<br />The right answer is False, but the code return True.<br />Anonymoushttps://www.blogger.com/profile/11820461832448641405noreply@blogger.comtag:blogger.com,1999:blog-2597841815280998418.post-7711085423705974122018-06-04T13:06:17.985+02:002018-06-04T13:06:17.985+02:00My pleasure :)My pleasure :)Mannyhttps://www.blogger.com/profile/07393063644320426727noreply@blogger.comtag:blogger.com,1999:blog-2597841815280998418.post-33509505643848754652018-06-03T21:41:53.130+02:002018-06-03T21:41:53.130+02:00Thank you very much for sharing this! This helped ...Thank you very much for sharing this! This helped me a lot!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2597841815280998418.post-51308982472136888282018-05-01T21:37:03.770+02:002018-05-01T21:37:03.770+02:00Thank you for your feedback!Thank you for your feedback!Mannyhttps://www.blogger.com/profile/07393063644320426727noreply@blogger.comtag:blogger.com,1999:blog-2597841815280998418.post-77454648846215015972018-05-01T19:42:59.072+02:002018-05-01T19:42:59.072+02:00Thank you for the solution.Thank you for the solution.Jobin Jacob Kavalamhttps://www.blogger.com/profile/12722034279867970476noreply@blogger.com