You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 11, 2022. It is now read-only.
#A restaurant networks want to open branches along a highway
#there are 'n' available places given in list m[]
#at each location you can open 1 restaurant and the profit will be according to list p[] in same index of m[]
#the distance between 2 branches has to be atleast 'k'
#write an algorithm that find the maximum profit locations arangement/
#1. calculating list c[] of closest place to open a restaraunt if i opened one at m[i]
#2. making a list of T - total profit, R - opened restaurants
#3. comparing 2 options - not opening a branch at location i and then T[i] will be the same as T[i-1]
# or opening a branch at location i and taking that branch profit (p[i]) + the total profit of the branches before it in distance of atleast k (T[c[i]])