Company: Salesforce
Difficulty: medium
Smallest Diverse String Problem Description A word is diverse if it does not contain three equal consecutive letters (for example, "aaba" is diverse, but "aaab" is not). What is the alphabetically smallest diverse word that can be built using exactly A letters "a", B letters "b" and C letters "c"? A, B and C are chosen in such a way that it is always possible to build such a word. Write a function: class Solution { public String solution(int A, int B, int C); } that, given three integers A, B and C, returns the alphabetically smallest diverse word that can be built. Examples Example 1: Input: A = 3, B = 1, C = 0 Output: "aaba" Explanation: With A = 3, B = 1 and C = 0, the function returns "aaba". Example 2: Input: A = 1, B = 4, C = 4 Output: "abbcbcc" Explanation: With A = 1, B = 4 and C = 4, the function returns "abbcbcc". Example 3: Input: A = 1, B = 3, C = 0 Output: "babb" Explanation: With A = 1, B = 3 and C = 0, the function returns "babb". Constraints A, B and C are integers with