Hackerrank #6: Array Left Rotation | C++ | Solution | Meandering array

  Рет қаралды 20,627

Knowledge Center

Knowledge Center

Күн бұрын

Пікірлер
@MerryEveryday
@MerryEveryday 4 жыл бұрын
This is a very good channel. Great explanation! I watched the video half, understood the logic I need to apply and implemented the code by myself. All test cases passed. Thanks!
@avnimahajan4417
@avnimahajan4417 2 жыл бұрын
vector rotLeft(vector a, int d) { for (int i=0;i
@krishanudutta2943
@krishanudutta2943 3 жыл бұрын
Thanks sir for helping us out
@KnowledgeCenter
@KnowledgeCenter 3 жыл бұрын
It's my pleasure
@sindhusiva4580
@sindhusiva4580 3 жыл бұрын
sir, how you started problem solving and how??
@sajalsuhane8644
@sajalsuhane8644 2 жыл бұрын
what will happen if value of d is greater than the size of vector?
@techlyric
@techlyric 7 ай бұрын
but it starts from a.begin and till d-1 as per your explanation, then why in code it is till d only?
@techlyric
@techlyric 7 ай бұрын
as in a.begin() +d, it should be rather (d-1)?
@krishanudutta2943
@krishanudutta2943 3 жыл бұрын
Sir can't we do it in normal way without using vector? pls help me sir...
@sohamkatkar4535
@sohamkatkar4535 4 жыл бұрын
I didn't understand why we iterated the second for loop till a.begin()+d. In the ex. we want to consider only the first two elements then why the loop is iterated from 0 to 2? Can someone explain.
@dipakkumarpanigrahi9264
@dipakkumarpanigrahi9264 4 жыл бұрын
Sir I tried this but it's showing segmentation fault in test cases 5 to 9
@KnowledgeCenter
@KnowledgeCenter 4 жыл бұрын
Can you share your code?
@dipakkumarpanigrahi9264
@dipakkumarpanigrahi9264 4 жыл бұрын
Sir please tell me the solution
@rishabhgoel9861
@rishabhgoel9861 4 жыл бұрын
Why are we using "auto it" instead of "int it" inside the for loop ?
@programmingwithsikander3539
@programmingwithsikander3539 4 жыл бұрын
auto is a c++11 construct where it determines the type of variable based on type of initializer. for further details refer kzbin.info/www/bejne/ZnqQl4l9oKx5iZI
@subhamjyoti1129
@subhamjyoti1129 4 жыл бұрын
since we are using it for vector , it should be written like this (vector::iterator it; ;) , it lengthy to right , so we use auto .
Hackerrank #7: New Year Chaos | C++ | Solution
18:45
Knowledge Center
Рет қаралды 15 М.
HackerRank Arrays : Left Rotation Explained - Java
5:26
Nick White
Рет қаралды 34 М.
Enceinte et en Bazard: Les Chroniques du Nettoyage ! 🚽✨
00:21
Two More French
Рет қаралды 42 МЛН
Cat mode and a glass of water #family #humor #fun
00:22
Kotiki_Z
Рет қаралды 42 МЛН
Hackerrank #5: 2d Array Hourglass | C++ | Solution
10:33
Knowledge Center
Рет қаралды 39 М.
How To Return An Array From A Function | C Programming Tutorial
13:01
Portfolio Courses
Рет қаралды 71 М.
Definition of Array
5:24
Neso Academy
Рет қаралды 911 М.
Arrays Left Rotation HackerRank Solution
11:52
JAVAAID - Coding Interview Preparation
Рет қаралды 47 М.
HackerRank Interview Prep Kit - Problem 8: Minimum Swaps 2
14:52
Dynamically Allocate An Array Of Structs | C Programming Tutorial
15:11
Portfolio Courses
Рет қаралды 38 М.
C++ STL algorithm - rotate algorithm | Modern Cpp Series Ep. 157
19:33
Enceinte et en Bazard: Les Chroniques du Nettoyage ! 🚽✨
00:21
Two More French
Рет қаралды 42 МЛН