What's the answer for "Sum of Digits" in Python ?
Up
up
Log in to post a comment.
What's the answer for "Sum of Digits" in Java ?
import java.util.*; public class Main { public static int sumOfDigits(String n) { if (n.length() == 1) { return Character.getNumericValue(n.charAt(0)); ...
Java answer import java.util.*; public class Main { public static int sumOfDigits(String n) { if (n.length() == 1) { return Character.getNumericValue(n.cha...
Please log in to like or dislike an comment.
We use cookies to enhance your experience on PaperSup. By clicking βAccept Allβ, you agree to the use of all cookies. Learn more in our Cookie Policy.