MCPcopy Create free account
hub / github.com/Tiwarishashwat/InterviewCodes / getDigitSum

Method getDigitSum

MaxSumOfAPairWithEqualSumOfDigits.java:2–9  ·  view source on GitHub ↗
(int num)

Source from the content-addressed store, hash-verified

1class Solution {
2 public int getDigitSum(int num){
3 int sum=0;
4 while(num>0){
5 sum += (num%10);
6 num/=10;
7 }
8 return sum;
9 }
10 public int maximumSum(int[] nums) {
11 // HashMap<Integer,Integer> map = new HashMap<>();
12 int map[] = new int[82];

Callers 1

maximumSumMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected