Category: Java
-
How to remove duplicate numbers in an Array of integers using stream
This is the third solution to remove the duplicate numbers from an Array of integers. This program uses distinct method of Stream in the Arrays.
-
How to reverse all the numbers in an array of integers using stream
This is the third solution to reverse all the numbers in the given array. This solution uses IntStream, range and map methods.
-
How to find the leader numbers in an array in the forward direction
This is the second solution to find the leader numbers in an array in the forward direction. An element is leader if it is greater than all the elements to its right side. And the rightmost element is always a leader
-
How to find the leader numbers in an array from the reverse direction
This is the first solution to find the leader numbers in an array from the backward direction. An element is leader if it is greater than all the elements to its right side. And the rightmost element is always a leader
-
How to find the minimum and maximum length strings in a sentence of strings using stream
This is the third solution to find the maximum and minimum length strings from a given input sentence of strings, using the reduce() methods of stream.
-
How to move zero’s to end in an array List of integers using streams
This is the third solution to move all Zero numbers to the end of an arrayList. This solution uses filter(), map() methods of stream. The resultant arrayList has all the exists zero’s moved to end.
-
How to find Nth largest number in an array list using streams
This is the fourth solution to find the Nth largest number from an array list of given integers or doubles or strings. This program uses the sorted(), and collectors() methods of stream.
-
How to find sum of digits in a number using stream
This is the third solution to find the sum of digits of an integer value[s]. This solution uses the map(), and reduce() methods of Arrays stream.
-
How to find Missing Prime numbers from any given sequence of integers
This is the first solution to find the missing prime numbers from any given sequence of integers. This solution uses the Lambda expression with single abstract method. The solution is finding all the missing prime numbers between every pair for consecutive numbers from the given sequence till end. The logic for prime check is the…
-
How to reverse each word in a sentence using StringBuffer class
This is the third solution to reverse each word in the given input sentence. This program uses the Single Abstract method, which implemented by using Lambda expression.
