Array Manipulation Java Coding Challenge | HackerRank | How'd You Code That?

Publicado em: 02 Agosto 2020
no canal de: Ed Clark
3,877
272

Array Manipulation on HackerRank: https://www.hackerrank.com/challenges...

By the end of this video, you should have a good understanding of the prefix sum algorithm, the method we’ll use to solve this challenge.

The problem statement for this challenge reads:

Starting with a 1-indexed array of zeros and a list of operations, for each operation add a value to each of the array element between two given indices, inclusive. Once all operations have been performed, return the maximum value in your array.

For example, the length of your array of zeros is 10 . Your list of queries is as follows:

The value “a” is the starting index in your array. The value ‘b’ is the ending index. The value ‘k’ is the integer to add to each element between the starting and ending indices of the array, inclusive. So, for the first query, indices 1 through 5 are incremented by 3, for a total of 3. The next query increments the values at the indices between 4 and 8 by 7, for a total of 10, at indices 4, and 5, and a total of 7 at indices 6 through 8. And the last query increments the values at the indices between 6 and 9 by 1, for a total of 8 at indices 6 through 8, and a total of 1 at index 9.

Once all operations have been performed, the largest value in the array is, 10.

Closed Captions/Subtitles - ed2clark@gmail.com

Video Editing - ed2clark@gmail.com

Song: Anywhere - Ikson (Vlog No Copyright Music)
Music promoted by Vlog No Copyright Music.
  / ikson  


Nesta página do site você pode assistir ao vídeo on-line Array Manipulation Java Coding Challenge | HackerRank | How'd You Code That? duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário Ed Clark 02 Agosto 2020, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 3,877 vezes e gostou 272 espectadores. Boa visualização!