Integer break problem using dynamic programming | LEETCODE#343

preview_player
Показать описание
Welcome to Joey’sTech.

In this video of my dynamic programming tutorial, we will look into the Integer Break problem which I have taken from the Leetcode website.

You can find the link in the description box below this video.

I found this problem really interesting and what makes it more interesting is that we can solve it using dynamic programming.

Let’s now see its problem statement.
The problem’s statement is very simple and easy to understand.
You are given an integer n.

You need to break this integer into those k positive integers, the product of which comes out maximum.
When n is equal to 2
You can only break it into 1 and 1, the product comes out as 1
When n is equal to 10

If you break it into 3 , 3 and 4 then you get the product as 36 which is what we need to find out.

You will learn to solve this interesting DP problem of intermediate level in this video of Joey'sTech.

Below is the Github link where you will find the java code related to this problem
Рекомендации по теме
Комментарии
Автор

Very clear explanation. Thank you so much!

julieirwin
Автор

Really interesting question with amazing explanation. Thanks for the solution

shuvabhigupta
Автор

More on Joey'sTech
Count all subsequences having product less than k

Tiling Problem using dynamic programming

Count possible decodings of a given digit sequence

Filling Bookcase Shelves Problem

Coin game winner when every player has 3 choices

joeystechpluscode