Question: solve coding problems data structures and algorithm problems YOU CANNOT USE ANY BUILT - IN FUNCTION EXCEPT len IN PYTHON. 1 . Merge Lineup: Now
solve coding problems data structures and algorithm problems
YOU CANNOT USE ANY BUILTIN FUNCTION EXCEPT lenIN PYTHON.
Merge Lineup:
Now you guys are playing a v fierce pokemon battle. At one point your and your teammate's pokemons have very low hp So you created a new rule to merge the hp of your and your teammate's pokemons and create a new pokemon lineup. But the opposite team placed a special condition. You and your teammate have to add the hp of your team's pokemons from opposite directions. That is your first pokemon's hp will be added to your teammate's last pokemon's hp; your second pokemon's hp will be added to your teammate's second last pokemon's hp and so on and so forth. The None elements denote hp You and your teammate have the same number of pokemons. Implement the scenario using a proper method which takes your and your teammate's pokemon hp as two arrays as parameters; and returns the resulting arr.
Sample Input Driver Code:
pokemon: None, None
pokemon: None
#Function Call: printmergeLineuppokemon pokemon
Sample Output:
#drivercode
def mergeLineuppokemon pokemon:
#To Do
printTask : Merge Lineup
pokemon nparray None
pokemon nparray None, None
returnedvalue mergeLineuppokemon pokemon
printfTask : returnedvalue # This should print
unittest.outputtestreturnedvalue, nparray
pokemon nparray None, None
pokemon nparray None
returnedvalue mergeLineuppokemon pokemon
printfTask : returnedvalue # This should print
unittest.outputtestreturnedvalue, nparray
Explanation:
Nonepokemonpokemon
pokemonpokemon
pokemonpokemon
Nonepokemonpokemon
Nonepokemonpokemon
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
