Question
You are a shipping manager for the Ostrich Express courier service. For the last 20 years of your life, you've hand calculated the supply of
You are a shipping manager for the Ostrich Express courier service. For the last 20 years of your life, you\\\\\\\'ve hand calculated the supply of ostriches you have available in each country. This required process takes an abundance of time: every single time a change occurs with available ostriches you have to perform calculations and resubmit the supply to your superiors. Finally, after almost a decade of failed HR requests, Ostrich Express has teamed up with Mathworks and has given you commercial access to MATLAB. Now, you are devoted to automating the shipping calculation process for the sake of the company!
ostrichExpress
- 1. (string ) A 1x4*N vector of all the ostrich’s locations
- 2. (string ) A 1x3 vector of the customer’s current location
Outputs:
- 1. (double ) A 1x1 number of available couriers
- 2. (string ) A 1x4*M vector of unavailable couriers
Function Description:
Given a string containing multiple 3-letter country codes with a trailing space and a string indicating the country code that corresponds to the customer’s location, determine how many available couriers there are and then list the unavailable couriers’ locations in their original order.
Example:
birds = \\\\\\\'DJI GHA MOZ DJI NER NER NER GHA\'
[available, unavailable] = ostritchExpress(birds,\\\\\\\'DJI\\\\\\\'); available → 2
unavailable → \\\\\\\'GHA MOZ NER NER NER GHA \\\\\\\'
Notes:
- ● All country codes are guaranteed to be three letters and separated by a single space (with a single space following the last country code).
- ● There will always be at least one unavailable courier
- ● The output string should follow the same formatting as the input string with respect to trailing spaces
Please answer questions fully without using conditional statements and iterations such as If, then, for, else for full credit. Solve problems using masking techniques!
Step by Step Solution
3.52 Rating (166 Votes )
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started