turaneminli / algorithms-task-1

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Algorithmic problem

This problem requires the solution for the optimal park roof cover.

How to run solution

In the solution directory, please run following command.

python park_slot.py

How to test solution

There will be three lines for user input after running code:

  1. Please enter "n" integer (number of parked places)
  2. Please enter "cars" list (takes n space seperated integers)
  3. Please enter "k" integer (the number of cars that have to be covered by the roof)

After submitting abovementioned inputs, it will give desired output.

Example test

4 is number of parked places; [6 2 12 7] is the parking spots where cars are parked; 3 is the number of cars that have to be covered by the roof;

6 is output for the minimum length of a roof that can cover k cars.

4
6 2 12 7
3
6

About


Languages

Language:Python 100.0%