ZOHO CORP Hiring On-Campus OA (2022) | Problem Sum of Digits in Base K
Question · Posted Jun 2026
Problem Statement You are given two integers: n representing a number in base 10. k representing a target base. Convert the number n from decimal (base 10) to base k and return the sum of all digits in its base-k representation. You do not need to explicitly build the converted number as a string. Instead, compute the digit sum directly during the conversion process. Example 1 Input n = 34 k = 6 Output 9 Explanation Convert 34 to base ...
The full answer & interview discussion are available to premium members.
Log in Create a free account