Array Manipulation | HackerRank Solution | Problem Solving | Data Structures - Arrays | C++ Solution

preview_player
Показать описание
Hi all,
In this video we will see 2 different approaches to solve Array Manipulation problem one is the Brute force method and another is optimal method using prefix sum technique.

Problem Link-

Code

Do like share and subscribe
Рекомендации по теме
Комментарии
Автор

I am new to programming so this might sound a little awkward question to you but as you are taking arr[a]+=k(when a=1), wouldn't it add the value k to the second element of the array, because array indexing starts from zero?
Please reply.

souviksaha
Автор

Finally some good fucking explanation.

GauravSingh-kuxy
Автор

This is called explanation. Keep it up bro👍

shaikhaejax
Автор

hello! youve explained it really well. thanks! btw i did the exact same things got of all the test cases, test case 1 didnt pass. can u please help

smarthguy_
Автор

bro how can we figure out that this approach has to be used?

nishanttrivedi