THE SOLUTION OF THIS ANSWER MUST BE C# public static int GetTreasure(Lint chests, int t) { //write your code here..

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

THE SOLUTION OF THIS ANSWER MUST BE C# public static int GetTreasure(Lint chests, int t) { //write your code here..

Post by answerhappygod »

THE SOLUTION OF THIS ANSWER MUST BE C#
public static int GetTreasure(Lint<int> chests,
int t) {
//write your code
here...
}
The Solution Of This Answer Must Be C Public Static Int Gettreasure Lint Int Chests Int T Write Your Code Here 1
The Solution Of This Answer Must Be C Public Static Int Gettreasure Lint Int Chests Int T Write Your Code Here 1 (56.45 KiB) Viewed 16 times
An adventurer finds himself in a dungeon full of treasures. However, before entering he has activated a trap, which in t minutes will flood the entire room. You are given an array of chests chests where chests is the number of treasures in the chest. The explorer can either pick up the treasure i, taking one minute, or move to the next chest (i+1), which also takes one minute. It starts at position zero, it is not necessary to reach the end of the array. Determine the maximum number of treasures the hero can collect. Input: • chests - number of treasures in chests, 2<length (chests) <20, 0<chests<100 • t - number of minutes away from flooding, 0<t<20 Output: • Integer - maximum number of collected treasures Example 1: chests = [1, 4, 2] t = 3 GetResult (chests, t) = 5 // In the first minute the hero collected treasures from
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply