tag:blogger.com,1999:blog-29632375.post769699311669646156..comments2022-09-27T20:17:00.094-07:00Comments on vexorian's blog: SRM 626: Not a math personUnknownnoreply@blogger.comBlogger3125tag:blogger.com,1999:blog-29632375.post-43804539458547795932014-07-06T01:18:09.594-07:002014-07-06T01:18:09.594-07:00Ah. Thanx a lot! Btw usage of yield was neat! :)Ah. Thanx a lot! Btw usage of yield was neat! :)nutr0nnoreply@blogger.comtag:blogger.com,1999:blog-29632375.post-69344016169611270682014-07-06T00:53:06.492-07:002014-07-06T00:53:06.492-07:00Since you are using the number of steps, the solut...Since you are using the number of steps, the solutions for a step Number will only need the solutions for the previous step Number (not all the smaller step numbers) so you only need to remember two steps at once, this does mean that your dp should be iterative not recursive, though.vexoriannoreply@blogger.comtag:blogger.com,1999:blog-29632375.post-86946321003503429262014-07-05T23:56:07.421-07:002014-07-05T23:56:07.421-07:00Even though the the relation is cyclic we can use ...Even though the the relation is cyclic we can use a third state which will accoutn for the number of operations. It did give correct results on the sample test cases, but i am not able to convert it into memoized form as adding 3rd state will take too much space. Can u suggest any way that I can use memoization in a memory efficient way.nutr0nnoreply@blogger.com