Showing posts with label Arrays. Show all posts
Showing posts with label Arrays. Show all posts

Saturday, January 26, 2019

2D Array - DS - Hacker Rank Solution

Given a  2D Array, :
1 1 1 0 0 0
0 1 0 0 0 0
1 1 1 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
We define an hourglass in  to be a subset of values with indices falling in this pattern in 's graphical representation:

Array Manipulation - Hacker Rank Solution

Array Manipulation - Hacker Rank Solution

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.

Minimum Swaps 2 - Hacker Rank Solution

Minimum Swaps 2 - Hacker Rank Solution

You are given an unordered array consisting of consecutive integers  [1, 2, 3, ..., n] without any duplicates. You are allowed to swap any two elements.

New Year Chaos - Hacker Rank Solution

New Year Chaos - Hacker Rank Solution

It's New Year's Day and everyone's in line for the Wonderland rollercoaster ride! There are a number of people queued up, and each person wears a sticker indicating their initial position in the queue. Initial positions increment by  from  at the front of the line to  at the back.

Arrays: Left Rotation - Hacker Rank Solution

Arrays: Left Rotation - Hacker Rank Solution
Check out the resources on the page's right side to learn more about arrays. The video tutorial is by Gayle Laakmann McDowell, author of the best-selling interview book 
Powered by Blogger.