Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

make learning more interactive and fun for students, a math teacher decides to teach a concept to students by using Lego blocks. There are 2

make learning more interactive and fun for students, a math teacher decides to teach a concept to students by using Lego blocks. There are 2 rows of legos, rowA (of length n) and rows (of length m). Both rows hold legos with positive integer values printed on them. However, some values (possibly, none) are missing. The missing values are denoted by 0. Students need to incorporate the missing values. The task is to replace each 0 with a positive integer such that the sums of both arrays are equal. Return the minimum sum possible. If it is not possible to make the sums equal, return -1.

Step by Step Solution

3.48 Rating (155 Votes )

There are 3 Steps involved in it

Step: 1

Step 1 Find the difference between the sums Lets calculate the sum of the numbers in each row ignoring the zeros for now Call these sums suma for row ... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Vector Mechanics for Engineers Statics and Dynamics

Authors: Ferdinand Beer, E. Russell Johnston Jr., David Mazurek, Phillip Cornwell, Brian Self

11th edition

73398241, 978-0073398242

More Books

Students also viewed these Programming questions

Question

In what ways does technology have an impact on job design?

Answered: 1 week ago