Cameras In Binary Tree | Leetcode 968 Binary Tree Cameras

Поділитися
Вставка
  • Опубліковано 5 лис 2024

КОМЕНТАРІ • 110

  • @satrap299792458
    @satrap299792458 3 роки тому +33

    Awesome explanation for a Leetcode Hard Problem. Made it Look like an easy level problem.

  • @yashgoswami9227
    @yashgoswami9227 2 роки тому +5

    on Leetcode : Hard Level Question
    on Pepcoding: easy toh tha yrr
    Amazing explanation!!

  • @ayushanand1032
    @ayushanand1032 2 роки тому

    No Words!!!! completely mindboggling!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

  • @Sagarkumar-pe1wj
    @Sagarkumar-pe1wj 3 роки тому +3

    I usually don't write comments... but you explanation is so great it made me write it...

  • @_inspireverse___
    @_inspireverse___ 2 роки тому +4

    You're awesome 🔥
    Whole Pepcoding team is awesome 🔥

  • @rohansinha2760
    @rohansinha2760 2 роки тому

    Shandaar explanation!!

  • @nitunsingh6986
    @nitunsingh6986 3 роки тому

    OMG Explanation on Peak. OP🔥🔥🔥🔥🔥🔥🔥🔥

  • @rohitshinde8478
    @rohitshinde8478 3 роки тому +5

    Rajneesh sir you are awesome teacher . Thank you for this wonderful explanation

    • @Pepcoding
      @Pepcoding  3 роки тому

      Glad to know that you liked the content and thank you for appreciating.
      The love and respect which I get from you people keep me highly motivated and the same I am able to forward It to you people through my videos.
      So, keep motivating, keep learning and keep loving Pepcoding😊

  • @MOHITGUPTA-tb2xl
    @MOHITGUPTA-tb2xl 2 роки тому

    great explanation sir. You have made the hard problem very easy.

  • @sdeBack1
    @sdeBack1 3 роки тому +1

    After seeing 4-5 videos, I found it is very easy to understand .. Thanks sir !

    • @Pepcoding
      @Pepcoding  3 роки тому

      Glad to hear that and you are most welcome.

  • @rishabhyadav4994
    @rishabhyadav4994 3 роки тому

    You make this question easy superb explanation

  • @aashishgoyal1436
    @aashishgoyal1436 3 роки тому +3

    Thanks for another awesome video sir. Request you to finish Linked list playlist as well

  • @shagilislam2533
    @shagilislam2533 Рік тому

    Awesome explanation.
    So smooth!

  • @subhanshugarg3477
    @subhanshugarg3477 2 роки тому

    I am amazed by your explanation🤩🤩

  • @lokeshmehta9591
    @lokeshmehta9591 2 роки тому

    great explain with include emotional expression...

  • @aviralgupta8860
    @aviralgupta8860 2 роки тому

    great explanation bro

  • @aasthaaggarwal8909
    @aasthaaggarwal8909 3 роки тому

    The explanation is made so easy to understand for such a hard question.

    • @Pepcoding
      @Pepcoding  3 роки тому

      Glad to know that you like our explanation.
      Visit - nados.pepcoding.com and sign up to NADOS.
      Also you can ask your doubts on community tab. There are lots of programmers and mentors who can help you out with such doubts.
      Don't forget to follow us on Instagram instagram.com/pepcoding/

  • @shruthib3366
    @shruthib3366 3 роки тому +2

    A very awesome and such a simple solution!! Thank you!!

  • @paragroy5359
    @paragroy5359 3 роки тому +1

    Nice explanation sir....thanks a lot for the video...explanation is really awesome

  • @tanishsharma5440
    @tanishsharma5440 2 роки тому

    Great explanation sir 🔥

  • @sunilpanchal1498
    @sunilpanchal1498 2 роки тому

    Mind blowing explanation 🔥🔥

  • @darkmode2982
    @darkmode2982 2 роки тому

    simple and easy Explanation. Thanks

  • @safargaadika4174
    @safargaadika4174 3 роки тому +2

    very nice explanation sir you guys are amazing. Pepcoding is like Amrit specially for tier 3 students. Thankyou very much

    • @Pepcoding
      @Pepcoding  3 роки тому +1

      Thank you for appreciating.
      The love and respect which I get from you people keep me highly motivated and the same I am able to forward It to you people through my videos.
      So, keep motivating, keep learning and keep loving Pepcoding😊

  • @sjmusic12
    @sjmusic12 Рік тому

    Wow amazing..

  • @rahulrawal5305
    @rahulrawal5305 2 роки тому

    great explanation 💯💯

  • @dreamfollowerdreamfollower8553
    @dreamfollowerdreamfollower8553 3 роки тому +4

    Great explanation. Thanks for the content !!

    • @Pepcoding
      @Pepcoding  3 роки тому +2

      I am glad you liked it. I also hope that you are watching till end and trying to understand the what, how and especially why of the problem.
      If you like our efforts, we request a review
      g.page/Pepcoding/review?rc
      You can subscribe to our channel here
      ua-cam.com/users/Pepcodingabout?view_as=subscriber

  • @amitbh4734
    @amitbh4734 2 роки тому

    Amazing explanation! subscribed!

  • @abhishekvishwakarma9045
    @abhishekvishwakarma9045 2 роки тому

    Best explanation 🔥

  • @mickyman753
    @mickyman753 3 роки тому

    boht pyara question tha,first time dekhne pr toh samaj nhi aya ki kaise hoga ,but sir ne kitna easy bna diya

  • @uttam402
    @uttam402 2 роки тому

    Amazing Explanation 🔥🔥

  • @jayantthakur8681
    @jayantthakur8681 3 роки тому

    kahani sunate sunate sir ne ek problem sikha diya thanks sir awesome

  • @prakhargarg4166
    @prakhargarg4166 9 місяців тому

    Hairstyle looking great

  • @JavaDSA-n7w
    @JavaDSA-n7w 3 місяці тому

    Great Explanation:)

  • @avnishkumar6780
    @avnishkumar6780 2 роки тому

    bahut mst samjhaya bhaiya

  • @shantanukumar4081
    @shantanukumar4081 2 роки тому +1

    Great explanation 👍👍👍

    • @Pepcoding
      @Pepcoding  2 роки тому +1

      Glad you liked it!
      Keep learning.
      And for better experience, visit nados.io, where you will get well curated content and career opportunities.

  • @yuktikhantwal2342
    @yuktikhantwal2342 3 роки тому

    great approach and explaination wow

  • @swapnilkumar4411
    @swapnilkumar4411 2 роки тому

    Best explanation

  • @shreyashachoudhary480
    @shreyashachoudhary480 2 роки тому

    Cool! Loved it

  • @proghead00
    @proghead00 2 роки тому

    Amazing explanation, no cap!
    "Ooof" moments all around.

  • @ayushbisht2689
    @ayushbisht2689 3 роки тому +2

    Sir the way you explain is next ->level order traversal.😂😂

  • @vaibhavgupta973
    @vaibhavgupta973 9 місяців тому

    thaaanku

  • @sujan_kumar_mitra
    @sujan_kumar_mitra 3 роки тому

    Nice explanation.

  • @rm3569
    @rm3569 2 роки тому

    Superb Explanation...🙏

    • @Pepcoding
      @Pepcoding  2 роки тому

      Thanks a lot 😊. Please visit nados.pepcoding.com for more content like this

  • @dsa3334
    @dsa3334 2 роки тому

    Thank you sir. Great explanation.

    • @Pepcoding
      @Pepcoding  2 роки тому

      Glad you liked it.
      Now, if you want to charge your career in coding sign up on nados.io and keep learning.

  • @souravchakraborty9777
    @souravchakraborty9777 2 роки тому

    What is the intuition of starting from the leaf node?

  • @nidhirathore7284
    @nidhirathore7284 2 роки тому

    Thank you sir 🙂

  • @ani68
    @ani68 2 роки тому

    Great explanation 💯

    • @Pepcoding
      @Pepcoding  2 роки тому

      Glad it was helpful!
      For better experience and well organised content visit - nados.io

  • @PankajDas-mw4uq
    @PankajDas-mw4uq 3 роки тому +1

    nice explanation sir....

  • @jabedakhtar5156
    @jabedakhtar5156 3 роки тому +1

    speechless.... awesome explanation ❤️

    • @Pepcoding
      @Pepcoding  3 роки тому

      Glad you liked it and If you like our efforts, please upvote the comments written by the students about Pepcoding here (www.quora.com/What-are-the-good-websites-to-learn-data-structures-and-algorithms )

  • @ShivamKendre-fc3su
    @ShivamKendre-fc3su Рік тому

    awesome bhai gbu

  • @pritampawar6478
    @pritampawar6478 3 роки тому +1

    Woah !! this explanation was 🔥🔥🔥

  • @sushmitabaral9416
    @sushmitabaral9416 3 роки тому

    Amazingly Explained Sir!!!

  • @loserfruit9663
    @loserfruit9663 3 роки тому +1

    Welcome back

  • @puneetpant20
    @puneetpant20 2 роки тому

    Crazy🔥

  • @Rahulkumar-op9lu
    @Rahulkumar-op9lu Рік тому

    just wow💯💯💯💯💯💯

  • @algorithmimplementer415
    @algorithmimplementer415 2 роки тому

    Excellent!

    • @Pepcoding
      @Pepcoding  2 роки тому

      Hope you love the explanation, for better experience and well organised content visit - nados.io

  • @hymnish_you
    @hymnish_you 3 роки тому

    Thank you very much sir

    • @Pepcoding
      @Pepcoding  3 роки тому +1

      Keep learning, Keep growing and keep loving Pepcoding!😊

  • @AYUSHKUMAR-eo5xi
    @AYUSHKUMAR-eo5xi 2 роки тому

    nice explanation

    • @Pepcoding
      @Pepcoding  2 роки тому

      Glad you liked it!
      Keep learning.
      And for better experience, visit nados.io, where you will get well curated content and career opportunities.

  • @prashantmishra2016
    @prashantmishra2016 2 роки тому +1

    great explanation. The only improvement I can suggest for this and other problems is discussing the run time and space complexity as well

  • @ridingbeast6063
    @ridingbeast6063 3 роки тому

    Best 💥

  • @exfcghjuhkj5449
    @exfcghjuhkj5449 3 роки тому

    thank you

  • @koushikdas1438
    @koushikdas1438 3 роки тому

    Sir, kindly give the problem link also of these problems so that we can code it up by ourselves :3

  • @dietpepsi7338
    @dietpepsi7338 3 роки тому

    trees playlist ho gyi complete?
    coloring game,max product of splitted bnary tree from leetcode kra dijye if possible

  • @rishinith
    @rishinith Рік тому

    you made it a cakewalk

  • @ujjwalmittal3785
    @ujjwalmittal3785 3 роки тому

    Is this problem available on pepcoding website

  • @rajsinghrajpoot8945
    @rajsinghrajpoot8945 3 роки тому +1

    Sir website par question available nhi hai

  • @farizma
    @farizma 3 роки тому

    Explanation is just so nice, easily understandable, ✨💕👏 just the explanation helped me write the code.

    • @Pepcoding
      @Pepcoding  3 роки тому

      Happy to hear that! and If you like our efforts, please upvote the comments written by the students about Pepcoding here (www.quora.com/What-are-the-good-websites-to-learn-data-structures-and-algorithms )

  • @PrashantKumar-wz3ex
    @PrashantKumar-wz3ex 3 роки тому

    Jitu bhaiya ki videos dalwa dijiye sir c++ bhot piche chl rha h

  • @wecan2729
    @wecan2729 2 роки тому

    code in c++
    class Solution {
    public:
    int ans=0;

    int find(TreeNode* root)
    {
    if(!root)
    {
    return 1;
    }

    int left=find(root->left);
    int right=find(root->right);
    if(left==-1||right==-1)
    {
    ans++;
    return 0;
    }
    else if(left==0||right==0)
    {
    return 1;
    }
    return -1;
    }
    int minCameraCover(TreeNode* root)
    {

    if(find(root)==-1)
    {
    ans++;
    }
    return ans;

    }
    };

    • @Pepcoding
      @Pepcoding  2 роки тому

      For better insight, visit nados.pepcoding.com

  • @ayushsrivastava6864
    @ayushsrivastava6864 3 роки тому +1

    one test case on leet code is unable to pass
    for input [0,0,null,0,null,0,null,null,0]

    • @ayushsrivastava6864
      @ayushsrivastava6864 3 роки тому

      please check it..........

    • @srinivasv1488
      @srinivasv1488 3 роки тому +2

      bro remove "public static" from "public static int cameras = 0". It will work

    • @ayushsrivastava6864
      @ayushsrivastava6864 3 роки тому

      @@srinivasv1488 can you please give me the the reason ?

  • @devenderpahadia
    @devenderpahadia 2 роки тому

    best

  • @nitishsingh3470
    @nitishsingh3470 3 роки тому

    sir apki playlist nahi mil rahi channel pe trees ka please make a playlist of tress;

  • @mykuver6234
    @mykuver6234 3 роки тому +1

    Sir it is not working on one case [0,0,null,0,null,0,null,null,0]
    output: 3
    expected: 2

    • @VishalKumar-sm8bo
      @VishalKumar-sm8bo 3 роки тому

      public static int cameras = 0;
      remove public static
      int cameras = 0;
      it will work.

    • @akashtn6682
      @akashtn6682 3 роки тому

      @@VishalKumar-sm8bo static ke bina kaise chalega bhai?

  • @LegitGamer2345
    @LegitGamer2345 3 роки тому

    awesome!!!!!

  • @ankit_irl
    @ankit_irl 2 роки тому

    And I thought this was a hard problem :o

  • @mastersk7440
    @mastersk7440 3 роки тому

    Sir ab c++ bhi suru kardo bahut picha hai hamara

  • @aayushraj7896
    @aayushraj7896 3 роки тому

    sir leetcode 1530 solution please

  • @anuragchoudhary4095
    @anuragchoudhary4095 3 роки тому

    Sir please please upload the videos level up ki videos kb tk upload jayengi sir
    utni jldi popularity milegi sir liek geeksforgeeks

  • @mohituniyal7
    @mohituniyal7 Рік тому

    I am buying a Camera.

  • @trevorPhillips284
    @trevorPhillips284 3 роки тому

    Sir apne ye question public nahi kiya.

  • @tanishjain9544
    @tanishjain9544 3 роки тому

    1339. Maximum Product of Splitted Binary Tree
    please make video on this too sir🆒🆒▶▶

  • @yashalwar
    @yashalwar 2 роки тому

    Java Solution: # leetocde.
    /**
    * Definition for a binary tree node.
    * public class TreeNode {
    * int val;
    * TreeNode left;
    * TreeNode right;
    * TreeNode() {}
    * TreeNode(int val) { this.val = val; }
    * TreeNode(int val, TreeNode left, TreeNode right) {
    * this.val = val;
    * this.left = left;
    * this.right = right;
    * }
    * }
    */
    class Solution {
    int camera=0;
    public int minCameraCover(TreeNode root) {

    if(helper(root)==-1){
    camera++;
    }
    return camera;
    }
    public int helper(TreeNode root){
    if(root == null){
    return 1;
    }
    int lc=helper(root.left);
    int rc=helper(root.right);
    if(lc==-1 || rc== -1){
    camera++;
    return 0;
    }

    if(lc==0 || rc==0){
    return 1;
    }
    return -1;
    }
    }

  • @abhishekk1231
    @abhishekk1231 2 роки тому

    Great explanation. Thanks for the content !!