Problem Statement
Refer to the problem statement given @ Hackerrank Super Reduced String
Code
This problem is solved through Recursion but I will be working on a better solution soon. However this code pass all the…
There are 2 ways of creating your own Java8 docker file depending upon the distribution.
# Add the base Image…
Setting up a Zookeeper Ensemble
The instructions are for simulating the set up of ensemble on a single machine. However with just the change in port numbers we can set it up on different machines in production.
Given an input string, reverse it in place and retain the whitespace positions as is.
For example: “xm l” =>”lm x”
Another example could be “xml json” => “nos jlmx”
Given a sorted integer array without duplicates, return the summary of its ranges.
For example, given [0,1,2,4,5,7], return ["0->2","4->5","7"].
[0,1,2,4,5,7]
["0->2","4->5","7"].
Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.
For example,"A man, a plan, a canal: Panama" is a palindrome.
"A man, a plan, a canal: Panama"
In a Binary Search Tree containing unique integers, find the distance between 2 nodes given access to those 2 nodes and the root of the BST. The distance between 2 nodes P and Q is the number of edges on the…
Given a binary tree, return the level order traversal of its nodes’ values. (ie, from left to right, level by level).
Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree.
According to the definition of LCA on Wikipedia: “The lowest common ancestor is defined…
Clone an undirected graph. Each node in the graph contains a label and a list of its neighbors.
label
neighbors
OJ’s undirected graph serialization:Nodes are labeled uniquely.We use # as a separator for each node, and , as a separator for…
#
,