Message on Whatsapp 8879355057 for DSA(OA + Interview) + Fullstack Dev Training + 1-1 Personalized Mentoring to get 10+LPA Guaranteed Job
0 like 0 dislike

in Online Assessments by Expert (119,150 points)
edited by | 392 views

1 Answer

0 like 0 dislike
Best answer
You are given integer arrays b and g of equal length n and a positive integer k. You must choose a subsequence of indices from nums1 of length k.

For chosen indices i1, i2, ..., ik, your score is defined as:

The sum of the selected elements from nums1 multiplied with the minimum of the selected elements from nums2. It can be defined simply as: (b[i1] + b[i2] +...+ b[ik]) * min(g[i1], g[i2], ... ,g[ik]). Return the maximum possible score.

A subsequence of indices of an array is a set that can be derived from the set {1, 2, ..., n} by deleting some or no elements.
by Expert (119,150 points)
edited by

Get best answers to any doubt/query/question related to programming , jobs, gate, internships and tech-companies. Feel free to ask a question and you will receive the best advice/suggestion related to anything you ask about software-engineering , development and programming problems .