## Java Program to Solve Median of Two Sorted Array Problem

We will solve Median of two sorted arrays problem here. It is a common problem solving question which is asked in interview rounds of companies like Amazon, Google, Microsoft & Goldman Sachs. We will use LeetCode problem “4. Median of Two Sorted Arrays” as example here. The problem states that: Given two sorted arrays nums1 … Read more

## Java Program For Shortest Unique Prefix Problem

Shortest Unique Prefix is an interview question which you can find in websites like GeeksForGeeks & InterviewBit. It is asked in Google interviews. The problem is as follows: Find shortest unique prefix to represent each word in the list.Input: [zebra, dog, duck, dove]Unique Prefix of each word is as below:zebra = zdog = dogduck = … Read more

## Better Explanation Of Order of People Heights Problem And Java Program To Solve It

We will be solving LeetCode problem “406. Queue Reconstruction by Height” here. The problem states that: You are given an array of people, “people“, which are the attributes of some people in a queue (not necessarily in order). Each people[i] = [hi, ki] represents the ith person of height hi with exactly ki other people in front who have a height greater than or … Read more

## How To Use Flash Drive In Both macOS And Windows Laptop

I have Mac OS & Windows laptops. I use both of them quite frequently. Now I have an external hard drive that I want to use for both Mac & Windows laptops. Basically the flash drive should be able to transfer or copy/paste files from Windows laptop to MacOS. Or I should be able to … Read more

## Java Program For Sum Root to Leaf Numbers

We will be solving LeetCode problem “129. Sum Root to Leaf Numbers” here. This is a common question which has been asked in interview rounds of Google & Microsoft. Problem definition is as follows: You are given the root of a binary tree containing digits from 0 to 9 only.Each root-to-leaf path in the tree … Read more

## Java Program for Least Common Ancestor Of A Binary Tree

We will solve LeetCode problem “236. Lowest Common Ancestor of a Binary Tree” here. The problem states that: 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 between two nodes p and q … Read more

## A Good Free Alternative To Collabedit

Many of us use Collabedit frequently to conduct technical interviews. It is a easy to use online code editor where code can be shared between interviewer & interviewee. It supports most of the common programming languages available like Java, C++, Python, PHP or JavaScript. But recently I have seen Collabedit having server problems frequently. Sometimes the website … Read more

## Java Program to Solve Sliding Window Maximum Problem

Here we will understand a common problem solving question from LeetCode. It is “239. Sliding Window Maximum”. You are given an array of integers nums, there is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the k numbers in … Read more

## Working Java Program For Largest Rectangle in Histogram

Here we will try to find a solution for largest rectangle in histogram problem. We will use “LeetCode 84. Largest Rectangle in Histogram” problem as an example here. It says: Given an array of integers heights representing the histogram’s bar height where the width of each bar is 1, return the area of the largest … Read more

## How To Embed Code Snippet In Blogger Blog Post Without Editing Template

There are several ways to add code box in Blogger blog posts. Many of them would suggest to edit blogspot template and add third-party CSS links. But I prefer a way that doesn’t require any tampering or modification of blogspot template. First of all, it is risky & you may corrupt template HTML. Secondly, if … Read more