Google Coding Question – Solved

4 Live
Balanced mixture Given A number of powerful resources and B number of weak resources. You have to select a balanced mixture of these resources. A balanced mixture has C resources containing no less than 4 powerful resources and no less than one weak resource. You are given integers A, B, and C. Each powerful and weak resource is unique in itself. Hence, two mixtures with the same number of powerful and weak resources are considered different if at least one of the resources is different in the 2 mixtures. Print the number of ways of selecting a balanced mixture with the given number of resources. Function description Complete the function Balanced(). This function takes the following 3 parameters and returns the required answer: - A: Represents the number of powerful resources - B: Represents the number of weak resources - C. Represents the number of resources in a balanced mixture Input format for custom testing 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 an integer A denoting the number of powerful resources. - The second line contains an integer B denoting the number of weak resources - The third line contains an integer C denoting the number of resources in a balanced mixture

Asked in: Google

Image of the Question

Question Image Question Image

All Testcases Passed βœ”



Passcode Image

Solution


Please login to view the solution


Related Questions

| As an operations engineer at Amazon, you are responsible for organizing the dis… |
| Amazon Books is a retail store that sells the newly launched novel "The Story o… |
| In an Amazon analytics team, the Analysts collectively have a preference for th… |
| AWS provides scalable systems. A set of n servers are used for horizontally sca… |
| A foundry in Hackerland makes an alloy out of n different metals. In the manufa… |
| An array of integers is almost sorted if at most one element can be deleted fro… |