Page 1 of 1

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

Posted: Tue May 24, 2022 7:42 am
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 17 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