Sum of Digits / Digital Rootjava
//--https://www.codewars.com/kata/541c8630095125aba6000c00/train/java //It might breach time limit if you don't make use of the formula. // digital_root(n) = (n - 1) % 9 + 1 public class DRoot{ public static int digital_root(int n){ return (n - 1) % 9 + 1; } }
To be done https://www.codewars.com/kata/541c8630095125aba6000c00/train/java