Tag: java coding solutions
-
How to check whether a number is Disarium or not
This is the second solution to check the number for Disarium. This solution contains the core logic to evaluate the sum of powers of all digits in descending order of the length of number. The Disarium number is say for a given number 351, evaluate the powers from the left side as power (3 *…
-
How to check whether a number is Armstrong number or not
This is the second solution to check the number for Armstrong. This solution contains the core logic to extract each digit from the given number, in parallel it will compute the sum of the cubes of each digit. The Armstrong number is say for a given number 153, evaluate the powers of cubes from any…
-
How to extract characters and numbers from an Alphanumeric value
This is the second solution to extract characters and numbers from an alpha numeric value into separate strings. This program scans each character and checks ASCII range of alphabets, and numbers.
-
How to check whether a number is Armstrong number or not
This is the first solution to check the number for Armstrong. This solution uses String class, and a couple of Character functions to evaluate the sum of the cubes of each digit in a given number. The Armstrong number is say for a given number 153, evaluate the powers of cubes from any side as…
-
How to find array triplets with sum of two elements equals other element in the same array
This is the first solution to find array triplets, with sum of any two numbers equals with any other element in the same array.
-
How to extract characters and numbers from an Alphanumeric value
This is the first solution to extract characters and numbers from an alpha numeric value into separate strings. This program uses the Character class methods.
-
How to reverse all the numbers at even positions in an array of integers
This is the first solution to reverse all the numbers at even positions. This solution modifies the same array. The resultant array has all the numbers reversed only even positions.
-
How to move all Zero numbers to end in an array of integers using temp array
This is the second solution to move all Zero numbers to the end of an array of integers. This solution uses the temporary array. The resultant array has all non-zero numbers moved left, and all Zero numbers moved to the end.
-
How to count whether any number in an array repeated twice or thrice
This is the second solution to count whether any of the number in an array repeated twice or thrice from the same array of integers using Collections class.
-
How to count whether any number in an array repeated twice or thrice
This is the first solution to count whether any of the number in an array repeated twice or thrice from the same array of integers using HashMap collection.
