Query regarding Question. The pick and not pick logic is not Working

Правка en1, от anmolsainiii23, 2023-12-03 11:05:00

Hi I was wondering how to solve this question. The question actually came today in the weekly contest. The Question Name is -: 2952. Minimum Number of Coins to be Added . And my general approach was to just try recursion here and use pick and not pick approach to find out the element from 1 to Target. It's giving me wrong answer in the Tc -: [1,4,10] Target -: 19. My answer is 3 while the correct answer is 2. Can we try this approach to find out the answer. I know it will give the TLE but just for the practice purpose I want to try recursion here.

Submission Link -: https://leetcode.com/submissions/detail/1111336437/

Теги recursion, dynamic programming, greedy

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский anmolsainiii23 2023-12-03 11:05:00 696 Initial revision (published)