Company: Mthree _6march
Difficulty: medium
Minimum Extra Chocolates Problem Description Given two boxes of chocolate A and B-chocolates representing the number of chocolates. Alex and Drake have, respectively. Alex is a very clever child and will only be happy if he receives a multiple of what Alex gets. You decided to buy some extra chocolates. Mathematically, The share of chocolates will be: k * (A + X) = (B + Y) for some non-negative integer X and Y and some positive integer k . What is the minimum number of extra chocolates (X + Y) that you need to buy? Note: The original chocolates (A and B) cannot be transferred among each other. Complete the function solution. The function takes 2 parameters and returns the solution. A: Represents the number of initial chocolates in Alex's box B: Represents the number of initial chocolates in Drake's box Input Format Note: Use this input format if you are testing against custom input or writing code in a language where we don't provide boilerplate code The first line contains A, denoting