Tag: Predicate
-
How to find the triplet numbers from an array whose sum is divisible by 9
This is the second solution to find the triplets of numbers in which their sum is divisible by 9 from an array of integers. This method uses the core logic of traversing array using 3 nested for loops, add any three numbers come across in each iteration, and then uses simple predicate to verify that…
-
How to find the pairs of numbers from an array whose sum is divisible by 9
This is the second solution to find the pairs of numbers in which their sum is divisible by 9 from an array of integers. This method uses the core logic of traversing array using nested for loops, add any two numbers come across in each iteration, and then uses a simple predicate to verify that…
-
How to check whether a given integer is prime number or not
This is the second solution to find whether the given integer number is prime or not using a simple predicate and another core logic that no number is divisible by more than half of itself.
