Message on Whatsapp 8879355057 for DSA(OA + Interview) + Fullstack Dev Training + 1-1 Personalized Mentoring to get 10+LPA Job
0 like 0 dislike
572 views
in Online Assessments by Expert (46,090 points) | 572 views

1 Answer

0 like 0 dislike
  1. Given a rehabilitation session cost A[] that represents cost at each day, number of required sessions X, and the required reset time between each two sessions Y. Find the minimum cost to have all required sessions satisfying the required rest time condition.

     

    Example: A = {4, 2, 3, 7}, X=2, Y=2

     

    answer should be 7 since the minimal cost to have two sessions with two days in between is to have the sessions at day 1, A[0] and day 3, A[2]

by Expert (46,090 points)