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:
- Please enter "n" integer (number of parked places)
- Please enter "cars" list (takes n space seperated integers)
- 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