This is going to be very short and precise article on how to setup you macbook pro with java and maven.

Now macbook is coming default with zsh shell.

Steps for Java setup:

— — — — — — — — — — — — — — — — —…


I came across these two questions and found similarities.

  1. Buy and Sell only 1 time to get maximum profit.
  2. Buy and Sell multiple times to get maximum profit.

Here comes the solutions for the same, The code is the same for both the questions but with minor differences.

Solution 1…


This is a good question, So decided to solve it.

Given two sorted arrays, such that the arrays may have some common elements. Find the sum of the maximum sum path to reach from the beginning of any array to end of any of the two arrays. We can switch…


This is marked as Hard on the geek's platform.

Given an odd integer n, find a matrix of size n x n with the following conditions:

  1. Each cell contains an integer from 1 and n (inclusive).
  2. No integer appears twice in the same row or the same column.
  3. All 1’s…


This question is similar to check if two trees are symmetric or not.

https://leetcode.com/problems/subtree-of-another-tree/

Given two non-empty binary trees s and t, check whether tree t has exactly the same structure and node values with a subtree of s. A subtree of s is a tree that consists of a…


Recently I study the topic and sharing the notes for the same.

Inner Classes

Without existing one type of object if there is no chance of existing another type of object then we should go for inner classes. …


I came across this question in an interview recently for the SDE-2 position.

There is a shop with old-style cash registers. the price of each item is typed manually. Given a list of items and their correct prices, compare the prices to those entered when each item was sold. …

Vipul Gupta

Software Developer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store