Category: Sum of digits
-
How to find sum of digits in a number
This is the complete solution to find the sum of digits from a given number using the String class, and a few methods. This solution covers all validations. Regular expressions are also used in this solution for validating the given input.
-
How to find sum of digits in an alpha numeric value
This is the first complete solution to find the sum of digits from a given alpha numeric value by mainly using String and Character class methods along with regular expressions and exceptions.
-
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 sum of digits in an integer value
This is the second solution to find the sum of digits of an integer value[s]. This solution defines a functional interface with single abstract method with lambda expression. The internal core logic converts an integer value to String, then parse each character to digit, and sums up each digit.
-
How to find sum of digits in an alpha numeric value
This is the second solution to find the sum of digits from a given alpha numeric value by using a functional interface with single abstract method and lambda expression. Internally it uses String and Character class methods.
-
How to find sum of digits in an alpha numeric value
This is the first solution to find the sum of digits from a given alpha numeric value by using String and Character class methods.
-
How to find sum of digits in a given float value
This is the second solution to find the sum of digits from a given float value, by using the String and Character methods.
-
How to find sum of digits in an integer value
This is the first solution to find the sum of digits from a given integer value using the core logic.
