Answered step by step
Verified Expert Solution
Question
1 Approved Answer
7) Define a function smartstack() that will take two 2D arrays of any size. It should: a) merge them horizontally if the arrays have the
7) Define a function "smartstack()" that will take two 2D arrays of any size. It should: a) merge them horizontally if the arrays have the same number of rows or b) merge them vertically if the arrays have the same number of columns. Then return the bigger merged array. If both dimensions match, it can return either orientation. If there are no dimensions that share the same size, the function should raise an error (use Google to figure out how to make your function raise an error). Make sure to test out your function to see if it works
Step by Step Solution
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