Showing posts with label Advanced. Show all posts
Showing posts with label Advanced. Show all posts

Friday, August 5, 2016

Almost sorted interval - Hacker Rank Solution

Shik loves sorted intervals. But currently he does not have enough time to sort all the numbers. So he decided to use Almost sorted intervals. An Almost sorted interval is a consecutive subsequence in a sequence which satisfies the following property:

Burger Happiness - Hacker Rank Solution

In Burger Town new burger restaurants will be opened! Concretely,  restaurants will open in  days, while restaurant  will be opened on day  and will be located at . The town should be imagined as an one dimensional line in which every object's location can be described by the  coordinate.

Roy and alpha-beta trees - Hacker Rank Solution

Roy has taken a liking to the Binary Search Trees(BST). He is interested in knowing the number of ways an array  of integers can be arranged to form a BST. Thus, he tries a few combinations, and notes down the numbers at the odd levels and the numbers at the even levels.

Coloring Tree - - Hacker Rank Solution

You are given a tree with N nodes with every node being colored. A color is represented by an integer ranging from 1 to 109. Can you find the number of distinct colors available in a subtree rooted at the node s?

Cube Summation - - Hacker Rank Solution

You are given a 3-D Matrix in which each block contains 0 initially. The first block is defined by the coordinate (1,1,1) and the last block is defined by the coordinate (N,N,N). There are two types of queries.
Powered by Blogger.