{"version":"1.0","type":"rich","title":"crude combination solution with dynamic programming","description":"This example prints a Pascal-style table of combinations for all values of n and k from 0 up to a user-supplied n. It shows the numerical result of each combination, formatted as “nCk = value”, in rows where k increments from 0 to n. The code uses a memoized factorial function with a preallocated list (`factorial_array`) to store intermediate results, implementing dynamic programming to avoid recomputation. It reads two integers from standard input and validates them, then iterates through nested `for` loops to generate and display each combination via the `combination` function, which relies on the factorial cache.","provider_name":"VizHub AI Studio","provider_url":"https://next.vizhub.com","html":"<iframe src=\"https://next.vizhub.com/viz/gist-156e930f7b420c9ae05db7c9fab9d488?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"1\"></iframe>","width":960,"height":500,"cache_age":3600}