ความคิดเห็น •

  • @josuke21
    @josuke21 หลายเดือนก่อน +14

    Your explanation is poor . Atleast dry run the code.

  • @sujansinhthakor2314
    @sujansinhthakor2314 หลายเดือนก่อน +1

    for problem c, if you just try to come up with answer of n = 4,5,6,7 then you eventually you will get the pattern.

  • @shubhamjha2486
    @shubhamjha2486 หลายเดือนก่อน

    Just great explanations. Big fan 🙏. Also , can you please tell me how to be so good at proving your solutions I mean you're just great !

  • @VaibhavSingh-rf2ud
    @VaibhavSingh-rf2ud หลายเดือนก่อน

    what about problem f?

  • @dhruv6102
    @dhruv6102 หลายเดือนก่อน

    came for question B. Sorry sir but not able to understand !

  • @nityas8049
    @nityas8049 หลายเดือนก่อน

    In problem D how does it make sure that it will print odd degree nodes only? If anyone knows please explain..

    • @hashirshaikh510
      @hashirshaikh510 หลายเดือนก่อน

      In a tree, if you check, all leaf nodes have a degree = 1
      So you can remove all leaf nodes first, and once you remove them, their parents will become the leaf node of the new tree formed due to their removal.
      And so on, you can just go on removing the leaf nodes until only root node is left
      So you can always remove n-1 nodes... basically just go on removing leaf nodes, then next set of leaf nodes...so on uptil only root node is left
      He is doing a dfs, where he is passing the vertex and its parent.
      When the dfs function is returning from its function call, it means the node now has no more children, and he is making a check that vertex != Parent ,which means its a leaf node, and hence you can just print it
      In this way you will print all leaf nodes in order uptil only the root node is left

    • @nityas8049
      @nityas8049 หลายเดือนก่อน +1

      @@hashirshaikh510 Thank you so much for your explanation

  • @TLE_Eliminators
    @TLE_Eliminators หลายเดือนก่อน

    Please fill the feedback form: forms.gle/3zBtR5zkbaVrxKzh7

  • @ankitshiksharthi3141
    @ankitshiksharthi3141 หลายเดือนก่อน

    Thumbnail??

  • @crazytourist6619
    @crazytourist6619 หลายเดือนก่อน +1

    Can anyone help me with TREE REMOVAL problem ? I did the same approach and implemented but code gives WA on hidden testcase, I'm unable to debug.. If anyone can help me find the testcase on which it is failing..
    MY CODE :
    #include
    using namespace std;
    #define int long long int
    #define endl "
    "
    #define all(v) (v).begin(), (v).end()
    #define vi vector
    void dfs(map &mp, int node, int parent, vector &vec)
    {
    for (auto ele : mp[node])
    {
    if (ele != parent)
    {
    dfs(mp, ele, node, vec);
    }
    }
    vec.push_back(node);
    }
    void solve()
    {
    int n;
    cin >> n;
    vector v;
    for (int i = 0; i < n; i++)
    {
    int x;
    cin >> x;
    v.emplace_back(x);
    }
    map mp;
    for (int i = 0; i < n - 1; ++i)
    {
    int u, v;
    cin >> u >> v;
    mp[u].push_back(v);
    mp[v].push_back(u);
    }
    int node = *(min_element(all(v)));
    cout

    • @_dragneel_
      @_dragneel_ หลายเดือนก่อน +1

      I think you are considering the min value as root but not the node with min value. For example, values are [6,7,8,5] then in your case root is 5 but it should be 4 (1-based indexing)

    • @crazytourist6619
      @crazytourist6619 หลายเดือนก่อน

      @@_dragneel_ Oh yes that was the problem. I confused indices and values. Thank you so much for pointing it out. 🙏🏼🫂

  • @captvashu8142
    @captvashu8142 หลายเดือนก่อน

    where to learn z algo or other string alfgoS>?

    • @Abc-lr4bf
      @Abc-lr4bf หลายเดือนก่อน

      cp algorithm

    • @kumkumslab5811
      @kumkumslab5811 หลายเดือนก่อน

      no need i think sliding window lagao ho jaega

    • @captvashu8142
      @captvashu8142 หลายเดือนก่อน

      @@kumkumslab5811 but for similar questions it is must
      \

  • @nishanttyagi3665
    @nishanttyagi3665 หลายเดือนก่อน

    can someone please help me with this for fifth question giving run time error
    #include
    using namespace std;
    int main()
    {
    int t;
    cin>>t;
    while(t--){
    string s;
    cin>>s;
    int ans=0;
    int n=s.length();
    if(n%2!=0) ans=0;
    else{
    int x=n/2;
    vectorprefix(n),suffix(n),mera(n);
    for(int i=0;i=0)
    prefix[i]=prefix[i-1]+s[i];
    else prefix[i]=s[0];
    }
    for(int i=n-1;i>=0;i--){
    if(i

  • @TheBaljitSingh
    @TheBaljitSingh หลายเดือนก่อน

    explanation can be better

  • @_ayush_NIT_Allahabad
    @_ayush_NIT_Allahabad หลายเดือนก่อน +2

    bakwas explaination, na sound hai, na dry run. should give more time on explanation and intution than just showing the code

  • @kumkumslab5811
    @kumkumslab5811 หลายเดือนก่อน +1

    d wala aache se clear nhi hua

    • @alankritsingh5222
      @alankritsingh5222 หลายเดือนก่อน +1

      jiski value minimum ho usko root assume kro aur kisi bhi tree me root hi hogi jo kabhi bhi ans me add nhi hogi(kyuki end me uski degree 0)hogi aur leaf ki degree 1 h to bottom to up move kro aur value ko score me add kro aur leaf ko store kr dena

    • @kumkumslab5811
      @kumkumslab5811 หลายเดือนก่อน

      @@alankritsingh5222 ohk got it thanks

  • @iitianshah_1502
    @iitianshah_1502 หลายเดือนก่อน +2

    yaar es bhaiya ka itna ganda explanation h , raghav bhiaya is fine

    • @ITACHIUCHIHA-dr8sz
      @ITACHIUCHIHA-dr8sz หลายเดือนก่อน +1

      idk man, i find his explanations good enough

  • @akshit6653
    @akshit6653 หลายเดือนก่อน +1

    Extremely poor explanation

  • @ankitris5201
    @ankitris5201 21 วันที่ผ่านมา

    poor explanation