/hackerrank

my hacker rank solution

Primary LanguageHTML

hacerrank

Here are all the challenges from hacker rank that i have solved.

My aim is not just to solve to probllem but to find the most optimal solutions :)

Birthday Cake Candles

Summary: Used hashedtable to simplify the time complexity to O(n)

Result:My hacker rank instance for birthday cake problem

Ice cream parlor

Summary: Used hashmap to simplify the time complexity to O(n)

Result:My hacker rank instance for Ice cream parlor problem

Tree top view

Summary: used DFS for tree travesal and then located the top view using resursion

Result:My hacker rank instance for Tree top view problem

Binary Search Tree: Insertion

Summary: Insert a new node into a binary tree

Result:My hacker rank instance for Binary search tree insertion

Binary Search Trees

Summary: calculate the max height of the tree

Result:My hacker rank instance for Binary search tree

Binary Search Tree : Lowest Common Ancestor

Summary: find the lowest common ancestor for any two nodes

Result:My hacker rank instance for Binary search tree for Lowest Common Ancestor