Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

An industrial company has N factories,each producing some pollution every month. The company has decided to reduce its total fume emissions by equipping some of

An industrial company has N factories,each producing some pollution every month. The company has decided to reduce its total fume emissions by equipping some of the factories with one or more filters. Every such filter reduces the pollution of a factory by half.When a second (or subsequent) filter is applied, it again reduces by half the remaining pollution emitted after fitting the existing filter(s).For example, a factory that initially produces 6 units of pollution will generate 3 units with one filter, 1.5 units with 2 filters and so on. You are given an array of N integers describing the amount of pollution produced by the factories. your task is to find the minimum of filters needed to decrese the total sum of pollution by at least half. Write a java program in which given an array of integers A of length N, returns the minimum number of filters needed to reduce the total pollution by at least half.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

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

Database Security

Authors: Alfred Basta, Melissa Zgola

1st Edition

1435453905, 978-1435453906

More Books

Students also viewed these Databases questions