Code With Ravinder
Code With Ravinder
  • 7
  • 23 698
Maximize The Sum | Hackerearth | Arrays | Hashing | DSA
This is a practice problem on Hackerearth.
Maximize The Sum is a very important and common problem asked by many companies among the top-notch too.
In this video, I will give you insights on what goes into one's head while solving a coding problem. I'll teach you how to understand problems, approach to find solutions and implement them.
In the end, I will explain some basic concepts of time and space complexity.
Timecodes
0:00 - Intro
0:38 - Problem Analysis
9:28 - Code Implementation
Hope this helps you to become a better programmer.
Please share your feedback in the comments.
If you like this video, give it a thumbs up to keep me motivated.
Subscribe for more such videos.
Share with your friends to spread more knowledge.
Thank You!
Problem Link: www.hackerearth.com/practice/data-structures/arrays/1-d/practice-problems/algorithm/maximize-sum-0423b95e/
LinkedIn: www.linkedin.com/in/ravinder-chauhan-2912b4169/
Переглядів: 464

Відео

Print All Sub-Arrays for a given Array | DSA
Переглядів 8962 роки тому
Printing all Sub-Arrays for a given Array is a very basic but important problem asked by many companies among the top-notch too. In this video, I will give you insights on what goes into one's head while solving a coding problem. I'll teach you how to understand problems, approach to find solutions and implement them. In the end, I will explain some basic concepts of time and space complexity. ...
Print All Sub-Arrays for a given Array (Alternate Way) | DSA
Переглядів 12 тис.2 роки тому
Printing all Sub-Arrays for a given Array is a very basic but important problem asked by many companies among the top-notch too. In this video, I will give you insights on what goes into one's head while solving a coding problem. I'll teach you how to understand problems, approach to find solutions and implement them. . . . . Hope this helps you to become a better programmer. Please share your ...
Maximum Subset Sum | Hackerearth | Arrays Practice Problem | DSA
Переглядів 2,3 тис.2 роки тому
This is a practice problem on Hackerearth. Maximum Subset of Array is a very important and common problem asked by many companies among the top-notch too. In this video, I will give you insights on what goes into one's head while solving a coding problem. I'll teach you how to understand problems, approach to find solutions and implement them. In the end, I will explain some basic concepts of t...
Ransom Note | Arcesium | Hackerrank | Hash Table Practice Problem | DSA
Переглядів 8852 роки тому
This is a practice problem asked by Arcesium on Hackerrank. In this video I will give you insights on what goes into one's head while solving a coding problem. I'll teach you how to understand problems, approach to find solutions and implement them. In the end I will explain some basic concepts of time and space complexity. Timecodes 0:00 - Intro 2:25 - Problem Analysis 7:00 - Code Implementati...
Minimum Operations | Hackerearth | Arrays Practice Problem | DSA
Переглядів 2,1 тис.3 роки тому
This is a practice problem from Hackerearth. In this video I will give you insights on what goes into one's head while solving a coding problem. I'll teach you how to understand problems, approach to find solutions and implement them. In the end I will explain some basic concepts of time and space complexity. Timecodes 0:00 - Intro 0:15 - Problem Analysis 5:23 - Code Implementation 8:30 - Extra...
Non Decreasing Arrays | Hackerearth | Arrays Practice Problem | DSA
Переглядів 5 тис.3 роки тому
This is a practice problem from Hackerearth. In this video I will give you insights on what goes into one's head while solving a coding problem. I'll teach you how to understand problems, approach to find solutions and implement them. Hope this helps to become a better programmer. Its my first video so please share your feedback in the comments. If you like this video, give it a thumbs up to ke...

КОМЕНТАРІ

  • @needsomeone3636
    @needsomeone3636 18 днів тому

    👍🏻👍🏻is there any way we can solve it in n*n using any data structure?? Btw your explanation is amazing . Thanks!

    • @codewithravinder6014
      @codewithravinder6014 18 днів тому

      @@needsomeone3636 No, since just the total elements to print is even more than n*n.

  • @survivor_voice
    @survivor_voice Місяць тому

    Hloo bhaiya, we meet in bfit college.... thanks for your guidance and this vedios is very useful for us

  • @Abhi-sj4wg
    @Abhi-sj4wg Місяць тому

    Isn't there more efficient way to do it?

    • @codewithravinder6014
      @codewithravinder6014 Місяць тому

      @@Abhi-sj4wg I think this is the most optimal way to do it. If you find anything better please let me know. 🤗

  • @rajenderreddykoduru7928
    @rajenderreddykoduru7928 Місяць тому

    Hi sir, nice explanation can make all videos in the same way of explanation

    • @codewithravinder6014
      @codewithravinder6014 Місяць тому

      @@rajenderreddykoduru7928 Hi, thank you for the feedback. 😀

  • @himanshuxD
    @himanshuxD 2 місяці тому

    bhai kaha job hai?

  • @techkid358
    @techkid358 2 місяці тому

    public class array_Question { static void subarray(int arr[]){ for(int i=0;i<arr.length;i++){ for (int j = i; j < arr.length; j++) { for (int k = i; k<=j; k++) { System.out.print(arr[k]+ " "); } System.out.println(" "); } } } public static void main(String[] args) { int arr[]={1,2,3,4,5}; subarray(arr); } }

  • @TatangwaBilly
    @TatangwaBilly 7 місяців тому

    The algorithm is good but it is not dynamic. if we use a different array of values the function will not give expected values

    • @codewithravinder6014
      @codewithravinder6014 7 місяців тому

      I have used arrray values equal to indexes just for simplicity and explanation. It will give the expected result. In the end I showed another example too. It will work for every array. Also you can checkout another way to solve same problem here ua-cam.com/video/SsHUK0_KPSk/v-deo.html&ab_channel=CodeWithRavinder

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

    ❤❤❤

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

    ❤❤❤

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

    Bro if we run this code it is giving sub array but I want to know how i,j,k nd k are working here? int arr[]={1,2,3,4}; for(int i=0;i<arr.length;i++){ for(int j=i;j<arr.length;j++){ for(int k=i;k<=j;k++){ System.out.print(arr[k]);

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

      That's what i tried to explain in the video 😅. But I have made a video on alternate way to solve this which might help you. ua-cam.com/video/SsHUK0_KPSk/v-deo.html&ab_channel=CodeWithRavinder

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

    Use red pen ... blue makes ur writing invisble

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

      Thank You for pointing out. I have made an alternate video for this. You can check it out here: ua-cam.com/video/SsHUK0_KPSk/v-deo.html&ab_channel=CodeWithRavinder

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

    can anyone tell me why there is no {0,3} or {0,2} subarrays and likewise subarrays in his answers?

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

      As I explained in the beginning Subarray is continuous (i.e. One after the other) part of an Array.

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

    Much simpler way is !!! Start j from i , n run the third loop from start to end that is from i to j , that's all

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

      I have explained the similar approach in this video. Please check it out. ua-cam.com/video/SsHUK0_KPSk/v-deo.html&ab_channel=CodeWithRavinder

  • @helloworld-n1z
    @helloworld-n1z Рік тому

    the way you explain is so deep , it helps

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

    public void findSummArray() { int[] arr = { 5,3,4,2,7}; string result=""; for(int i=0; i<arr.Length; i++) { for(int j=i;j<= arr.Length; j++) { for (int k = i; k <j; k++) { result += arr[k].ToString() + ","; } result += " "; } } Console.WriteLine(result); } It Works .. My logic

  • @AbhilashSoni-e7g
    @AbhilashSoni-e7g Рік тому

    Can i have your contact details i.e number of email ?

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

    Very helpful

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

    Thanks bro

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

    very helpful

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

    thanks bud

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

    Well explained.

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

    Good work

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

    Need Help In Coding Please Reply Soon.

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

    Need Help In Coding Please Reply Soon.

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

    Need Help In Coding Please Reply Soon.

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

    Need Help In Coding And Reply Soon Plz.

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

    : there are n elements in an array . all the elements have their initial values , and their values increase with an element having a non zero value increasing the value of surrounding element by 2 each day.for example if the value of ith element is non zero then the value of(i-1) th element will get inceremented by 2 as well the value of(i+1) th element will get incremented by 2(if they exist) lets call the initial days,day0 and after that each consecutive will be reffered to as day 1,day2 and so on.now you have to find total extra value of all elements that would have been increased on day p compared to day 0(input 1st line :5 2 Sec line: 0 5 0 4 0 output- 24..] Plzzz solve this que

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

    Given an array A of N integers A1, A2, A3,.... AN, you have to answer Q queries. Each query consists of two integers L and R ( 1< or equal to L < or equal to R < or equal to N) let Di be the smallest integer greater than 1 that divides Ai. Find out DL+DL+1+DL+2+..... +DR for each query.. (Explanation sample1 first query: D1+D2=2+2=4..... Sec D3+ D4+D5=2+17+2=21 Third D6 = 5 ( code in java)

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

    Nice one bro👏

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

    Hello make vedios from starting ( Hackerearth Dsa) nd make the playlist

  • @its.revolutionary7266
    @its.revolutionary7266 Рік тому

    Sir you make it more easy to understand Through your amazing explanation

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

    💯💯

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

    We'll done beta , keep it up 👍🏻👍🏻👍🏻💖🎉

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

    👏👍

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

    👍👍👍

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

    coool 👍👍👍

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

    explanation is too good 💯💯💯

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

    Solve the maximize the sum hackerearth in java( with Array)and provide code

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

      Please share me the question link.

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

      @@codewithravinder6014 there is no option to share in UA-cam.. Plzzz go hackerearth Dsa problem Array and Que Maximize The Sum

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

      @@ramamishra9502 Here is the link to solution www.hackerearth.com/submission/81042469/

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

      @@codewithravinder6014 thnx but can u do this with only easy approach ( only with Array)

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

      @@ramamishra9502 Its not possible to solve only by using Arrays in required Optimal Time Complexity. You need to use atleast ArrayList or Hashing. This question is not of basics, its a mistake from Hackerearth. You can confirm the same in discussions or editorial solution.

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

    amazing dod thx ❤❤👌👌

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

    n you please do the seclore exam code

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

    😇🙂 I have learnt alot from u,, the way make us understand basics of topics and problem solving skill ,,, are amazing really ,,, best teacher glad be your student

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

    nice way of explaining things.. m your student from NS

  • @Simrat.Singhs
    @Simrat.Singhs Рік тому

    Superb👍👍

  • @ap.anandprakash
    @ap.anandprakash 2 роки тому

    Seems very easy after watching this, thankyou😇

  • @Riteshkumar-ih7fj
    @Riteshkumar-ih7fj 2 роки тому

    Nicely explained 👌

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

      Thank you 🙂

    • @Riteshkumar-ih7fj
      @Riteshkumar-ih7fj 2 роки тому

      @@codewithravinder6014 sir can u please make a video on find the square root of a number without using inbuilt function by binary search.

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

      @@Riteshkumar-ih7fj Sure will make in future. 😀

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

    Awesome😄🔥🔥

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

    Very helpful videos, excited after watching these rockstar videos💪

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

    💫

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

    Very well explained Sir🔥

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

    Oh sir ... learn so many new things through this thank u sir .... me NEETU