Create a function that inverts words or the phrase depending on the value of parameter type. A "P" means to invert the entire phrase, while a "W" means to invert every word in the phrase. See the following examples for clarity.
inverter("This is Valhalla", "P") ➞ "Valhalla is this"
inverter("One fine day to start", "W") ➞ "Eno enif yad ot trats"
inverter("Division by powers of two", "P") ➞ "Two of powers by division"