## How to Find Sub Array Having Negative Sums

In this example, we’ll find sub array having negative sums: An array’s sum is negative if the total sum of its elements is negative. For Example, 1. Java Output: Complete Java Solutions can be found here: Github Link

## How to Reverse Array In Place

In this example, we’ll see how to reverse array in place (without creating a new array). 1. Java Output: Complete Java Solutions can be found here: Github Link

## How to Remove Duplicates From Array

In this example, we’ll see how to remove duplicates from array: 1. Java Output: Complete Java Solutions can be found here: Github Link

## How to Find Minimum Distance Between Two Numbers

In this example, we’ll see how to find minimum distance between two numbers 1. Java Output: Complete Java Solutions can be found here: Github Link

## How to Merge Two Sorted Arrays

In this example, we’ll see how to merge two sorted arrays: Algorithm: Create an arr3[] to store all sorted elements Loop through arr1[] and arr2[] and compare each element to both the arrays Copy smaller element from arr1[] and arr2[] to arr3[] and move ahead in arr3[] and in the array whose element was picked. …

## How to Left Rotate an Array

In this example, we’ll see how to left rotate an array: 1. Java Output: Complete Java Solutions can be found here: Github Link

## How to Find Leaders in an Array

In this example, we’ll find leaders in an array. An element of an array is a leader if it is greater than or equal to all the elements to its right side. The rightmost element is always a leader. 1. Java Solution with time complexity O(n2) Output: Solution with time complexity O(n) Output: Complete Java …

## How to Find Unique Number That Is Not Repeated Twice

In this example, we’ll find a unique number that is not repeated twice: 1. Java Output: Complete Java Solutions can be found here: Github Link

## How to Find Possible Triangles in an Array

In this example, we’ll find possible triangles in an array: Algorithm: (Approach #1) Run three nested loops, each loop starting from the index of the previous loop to end of the array. Check if sum of two sides is greater than the third. If all three conditions match, (that means it is a possible triangle), then …

## How to Find Missing Number From Integer Array

In this example, we’ll find missing number from Integer array but this method works only with a set of integers that are sorted and are in sequence like below: This is a common question asked in Java Interviews. 1. Java Output: Complete Java Solutions can be found here: Github Link