Your favorite local restaurant has caught onto the health food trend, and has begun publishing basic nutritional information for all of their most popular menu selections. This is excellent timing, since your doctor has recently recommended various diet plans for you and several of your friends.
You are given int protein, int carbs, and int fat, representing the number of grams of protein, carbs, and fat in each of the available menu items. Elements from each int correspond to the elements of the other ints with the same index.
You are also given a String dietPlans, indicating the doctor's recommendation for how each person should make their meal selection. Each element of dietPlans describes the diet plan for an individual. Each character of each element of dietPlans specifies, in order of importance, a selection criteria, defined in the following way:
As an example, the diet plan "tf" means the doctor recommends a meal with the lowest possible calories, and if more than one is tied, the one with less fat should be selected. Whenever more than one meal is tied according to the diet plan, then the one with a lower index should be selected.
The restaurant sloppily neglected to list the total calorie count on the menu. Fortunately, you happen to remember from days gone by that one gram of fat contains 9 calories, and one gram of carbs or protein contains 5 calories.
You are to return a int indicating the indexes of the menu selections that best suit each person's diet plan (indexed from 0). The return int should have the same number of elements as dietPlans, and each value of the return int should correspond to the element of dietPlans with the same index.
|-||When no diet plan is specified, the default should be the menu selection with the lowest index (0).|
|-||carbs will contain between 1 and 50 elements, inclusive|
|-||protein will contain between 1 and 50 elements, inclusive|
|-||fat will contain between 1 and 50 elements, inclusive.|
|-||carbs, protein, and fat will each contain the same number of elements.|
|-||Each element of carbs, protein, and fat will be between 0 and 100, inclusive.|
|-||dietPlans will contain between 1 and 50 elements, inclusive.|
|-||Each element of dietPlans will be between 0 and 4 characters in length, inclusive, and will contain only the characters "CcPpFfTt".|