17 April,2024 Problem 2 Easy - Medium|| TCS NQT Coding Question. || Array.

Поділитися
Вставка
  • Опубліковано 18 жов 2024
  • Detail Solution of the TCS NQT Coding Question.

КОМЕНТАРІ • 5

  • @shubhankarjain2038
    @shubhankarjain2038 5 місяців тому

    Sir i have a query like i gave tcs paid nqt on 17th april and I solved one question partially 4/7 test cases and other question completly and in my overall scorecard i got 79.59 then there will be any chances that i will get mail for any profile in tcs or by other tcs affiliated companies.

  • @sravantipris3544
    @sravantipris3544 6 місяців тому

    But for multiple test cases it fails for example input arr={1,5,6,9} and n=11 it fails so,better to use DP in it

    • @rushiprajapati4597
      @rushiprajapati4597  6 місяців тому

      Weight of stone is already given in the problem. Your task is to find the cnt with the help of given weight. W[] is fix. It is not taken by the user...
      IF the W[] is custom than we can use DP approach...

  • @saathnibhanasathiya7727
    @saathnibhanasathiya7727 6 місяців тому

    bhai glt h aapka solution dp lagao solve ho jayega aap aik test case lo weight - 1 2 25 47 and here n = 50 yha aaapna soltion fail ho jayega

    • @rushiprajapati4597
      @rushiprajapati4597  6 місяців тому +1

      Weight Is already given (1,2,5,10,20,50,100,500,1000)
      Using thus Weight find the Minimum number of Weight stone...
      So that's why DP is not Needed. BTW this is very easy question.