We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Billboards
Billboards
Sort by
recency
|
47 Discussions
|
Please Login in order to post a comment
!/bin/python3
import math import os import random import re import sys
#
Complete the 'billboards' function below.
#
The function is expected to return an INTEGER.
The function accepts following parameters:
1. INTEGER k
2. INTEGER_ARRAY revenue
# def billboards(n,k, revenue): N,K=n,k total = sum(revenue)
if name == 'main': fptr = open(os.environ['OUTPUT_PATH'], 'w')
Phew, so finally solved this after weeks. It basically comes down to idea of min_queue problem. i.e, you can look up minimum of 'M' consecutive terms as you move from left to right in an array in O(1).
Phew, so finally solved this after weeks. It basically comes down to idea of min_queue problem. i.e, you can look up minimum of 'M' consecutive terms as you move from left to right in an array in O(1). Salah Al Din Metro Station Dubai
Here is my solution in java, javascript, python, C, C++, Csharp HackerRank Billboards Problem Solution
Here is Billboards problem solution - https://programs.programmingoneonone.com/2021/07/hackerrank-billboards-problem-solution.html