Showing 20 of 332 from page 1

## Mandragora Forest | HackerRank Problem | Java Solution

Solution for hackerrank problem Mandragora Forest in Java. The evil forest is guarded by vicious mandragoras. Garnet and her pet must make a journey through. She starts with pet health point s and 0 e

## Convert Binary Search Tree to Doubly Linked List | Java Solution

Program to convert a binary search tree to doubly linked list with in order traversal. The left and right pointers in nodes are to be used as previous and next pointers respectively in converted Circu

## Matching parenthesis | Google Interview Question & Solution

Here s your coding interview problem for today. This problem was asked by Google. Given a string of parentheses, write a function to compute the minimum number of parentheses to be removed to make the

## Balanced brackets | Uber Interview Question & Solution

Imagine you are building a compiler. Before running any code, the compiler must check that the parentheses in the program are balanced. Every opening bracket must have a corresponding closing bracket.

## Checking subset sum | Facebook Interview Question & Solution

This problem was asked by Facebook. Given a multiset of integers, return whether it can be partitioned into two subsets whose sums are the same. For example, given the multiset  15, 5, 20, 10, 35, 15,

## Non-decreasing Array | Facebook Interview Question & Solution

This problem was asked by Facebook. Given an array of integers, write a function to determine whether the array could become non decreasing by modifying at most 1 element. For example, given the array

## Get number using bit math operations | Facebook Interview Question & Solution

This problem was asked by Facebook. Given three 32 bit integers x, y, and b, return x if b is 1 and y if b is 0, using only mathematical or bit operations. You can assume b can only be 1 or 0. Idea be

## [Solution] Number of "islands" in the matrix | Amazon Interview Question

This problem was asked by Amazon. Given a matrix of 1s and 0s, return the number of islands in the matrix. A 1 represents land and 0 represents water, so an island is a group of 1s that are neighborin

## [Solution] Compare Tree Structure | Google Interview Question

This problem was asked by Google. 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 consists o

## [Solution] Course Dependency | Airbnb Interview Question

This problem was asked by Airbnb. We re given a hashmap associating each courseId key with a list of courseIds values, which represents that the prerequisites of courseId are courseIds. Return a sorte

## [Solution] rand5 | Two Sigma Interview Question

This problem was asked by Two Sigma. Using a function rand7  that returns an integer from 1 to 7  inclusive with uniform probability, implement a function rand5  that returns an integer from 1 to 5  i

## [Solution] List of possible overlapping intervals | Snapshat Interview Question

This problem was asked by Snapchat. Given a list of possibly overlapping intervals, return a new list of intervals where all overlapping intervals have been merged. The input list is not necessarily o

## [Solution] reverse-linked-list | Google Interview Question

This problem was asked by Google. Given the head of a singly linked list, reverse it in place. Idea behind the solution Consider this list 1 2 3 4 5 The reverse would be 5 4 3 2 1 or 1

## [Solution] numbers-sum-to-k | Facebook Interview Question

This problem was recently asked by Facebook You are given a list of numbers, and a target number k. Return whether or not there are two numbers in the list that add up to k. Example Given  4, 7, 1 , 3

## [Solution] Longest-Sequence-With-2-Numbers | Facebook Interview Question

This problem was recently asked by Facebook Given a sequence of numbers, find the longest sequence that contains only 2 unique numbers. Example Input   1, 3, 5, 3, 1, 3, 1, 5  Output  4 The longest se

## Solution for finding k-th last element | Airbnb Interview Question

Hi, here s your problem today. This problem was recently asked by AirBNB You are given a singly linked list and an integer k. Return the linked list, removing the k th last element from the list. Try

shihab posted in #java #tutorial

## How to Install NetBeans on Ubuntu 20.04

NetBeans is a popular IDE for Java and other application development. Which allows applications to be developed from a set of modular software components called modules. NetBeans is available to run o

anonymous posted in #java #codingchallenge

## Manasa and stones hackerrank solution in java

Manasa is out on a hike with friends. She finds a trail of stones with numbers on them. She starts following the trail and notices that any two consecutive stones numbers differ by one of two values.

## Beautify Java Code With Prettier In Node.JS | Javascript Example

Prettier is an opinionated code formatter which support many languages. In this example we will see how to prettify java code. NPM Modules We need Prettier Prettier Java NPM Installation npm install s

## Java Solution For HackerRank Problem: Trees: Is This a Binary Search Tree?

Trees Is This a Binary Search Tree?, is a HackerRank problem from Data Structures subdomain. In this post we will see how we can solve this challenge in Java For the purposes of this challenge, we de 