Category: Special numbers
-
How to find the nth Fibonacci number in the series?
This is the complete solution to find the nth Fibonacci number in the series. This solution is designed to solve the problem using an interface, super class and three derived classes implementing the interface.
-
How to check whether a given number is ArmStrong number or not?
This is the complete solution to check whether a given number is ArmStrong number or not. This solution is designed to solve the problem using an interface, super class and three derived classes implementing the interface.
-
How to check whether a number is Disarium or not using stream
This is the second solution to check the number for Disarium. This solution uses IntStream, reduce methods of Stream. The Disarium number is say for a given number 351, evaluate the powers from the left side as power (3 * 1) + power (5 * 2) + power (1 *3) , the sum of all…
-
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 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 check whether a number is Armstrong number or not
This is the third solution to check whether a given number is Armstrong number or not. This program uses the map() and reduce() methods of java streams.
