1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
slava [35]
4 years ago
12

There are N rectangular buildings standing along the road next to each other. The K-th building is of size H[K] × 1.

Computers and Technology
1 answer:
Sphinxa [80]4 years ago
8 0

Answer:

# you can write to stdout for debugging purposes, e.g.

# print("this is a debug message")

def solution(H):

   # write your code in Python 3.6

   

   # return area of atmost 2 banners

   # 1 banner

   # maximum height * number of buildings

   single_banner = max(H) * len(H)

   smallest_area = single_banner

   

   

   # 2 banner

   for i in range(1, len(H)):

       double_banner = (max(H[0:i]) * len(H[0:i])) + (max(H[i:]) * len(H[i:]))

       if  double_banner < smallest_area:

           smallest_area = double_banner

   

   return smallest_area

You might be interested in
Atheel tests a program and gets a NameError. How can this be fixed?
Oksana_A [137]

Answer:

You can't call a function unless you've already defined it. Move the def createDirs(): block up to the top of your file, below the imports.

Explanation:

Some languages allow you to use functions before defining them. For example, javascript calls this "hoisting". But Python is not one of those languages.

7 0
3 years ago
Read 2 more answers
6 The part of the computer that contains the brain or central processing unit is also known as the ?
Olin [163]
Answer:  "CPU" .
________________________________
4 0
3 years ago
Selective colleges choose to have in-person meetings to learn more about the applicants. These meetings are called:
lubasha [3.4K]
The meeting is called collage interviews
4 0
3 years ago
Read 2 more answers
A married man gets a new job in a company. After three months, he meets a younger woman in the finance department and they begin
pav-90 [236]

Answer:

False ( B )

Explanation:

Of  the seven IT  infrastructure domains The USER domain was not at risk because the User Domain is not task with handling the sharing of data or Mutual communication between users in a Typical IT infrastructure.

The domain charged with such responsibility is The LAN domain because the LAN domain is charged with the sharing of information between the USERS and maintaining good mutual communication, and since the relationship has become sour, the sharing of information between the users will suffer the most and it will be at a high risk

5 0
3 years ago
Write java code to create a new class called "student". an object of the student class has attributes like student id, name and
Fiesta28 [93]
Here you go. I added a constructor and a toString overload to make the object creation and printing as easy as possible.

public class student {
    private String _id;
    private String _name;
    private String _address;

    public student(String id, String name, String address) {
        _id = id;
        _name = name;
        _address = address;
    }

    public String toString() {
        return "Id: " + _id + "\nName: " + _name + "\nAddress: "+ _address;
    }

    public static void main(String[] args) {
        student s1 = new student("S12345", "John Doe", "Some street");
        System.out.println(s1);
    }
}

8 0
3 years ago
Other questions:
  • You use a(n) ____ variation when a use case is less specific than others, and you want to be able to substitute the more specifi
    8·1 answer
  • Type the correct answer in the box. Spell all words correctly.
    11·1 answer
  • In a @return tag statement the description:
    13·2 answers
  • Which of the following methods is the easiest way to set up a VPN client on a computer for a user who is not technical?
    12·1 answer
  • What is an example of a transition effectl
    7·1 answer
  • Technician A says that it's a good idea to perform a test drive before attempting repairs. Technician B says that it's a good id
    9·2 answers
  • Write a Unix (Linux) find-like command (myFind) in Python3 where the function will return the full paths of all the files contai
    9·1 answer
  • Your textbook discussed a record store example where one user could perform a query to determine which recordings had a track le
    14·1 answer
  • _____ allows a function or operator to perform different tasks depending on the types of the arguments or operands. Group of ans
    10·1 answer
  • Your client Mr. Smith has requested a reservation at Eleven Madison Park this evening for a party of 2 at 6PM. Unfortunately, th
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!