Maximize The Cut Segments | Dynamic Programming | GFG POTD | C++ | Java | Code Kar Lo

preview_player
Показать описание
Given an integer n denoting the Length of a line segment. You need to cut the line segment in such a way that the cut length of a line segment each time is either x , y or z. Here x, y, and z are integers.
After performing all the cut operations, your total number of cut segments must be maximum. Return the maximum number of cut segments possible.

Note: if no segment can be cut then return 0.

0:00 Introduction
0:11 Problem Statement
1:28 Explanation
7:19 C++ Code
13:04 Java Code

gfg potd
gfg potd today
gfg problem of the day
potd gfg
potd
potd today
gfg

#dsa #datastructures #algorithm #gfg #potd #coding #array #strings #tree #binarysearchtree #codekarlo #dynamicprogramming
Рекомендации по теме
Комментарии
Автор

Check ex: n=7, x=2, y=4, z=5
Why can't we cut 7 3 times with x??
Why the ans here is 2, by using x and z ??
Wrong problem

LC-VanshRajput
visit shbcf.ru