Tag: range
-
How to check whether a given integer is prime number or not ?
This is the complete solution to check whether a given integer number is prime or not. This solution is designed to to solve the problem using an interface, super class and four derived classes implementing the interface. The core logic is to check the divisibility of the given number, from 2 to till the square…
-
How to find the leader numbers in an array using stream
This is the third solution to find the leader numbers in an array in the reverse direction using stream. 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 Missing Prime numbers from any given sequence of integers using Stream
This is the second 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 also uses the range, filter, foreach methods of IntStream.
-
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 factorial of a number using Stream
This is the fifth solution to find the factorial of a number using Stream. This program uses the LongStream, range(), reduce() methods.
