We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Superman Celebrates Diwali
Superman Celebrates Diwali
Sort by
recency
|
26 Discussions
|
Please Login in order to post a comment
Here is my solution in java, javascript, python, C, C++, Csharp HackerRank Superman Celebrates Diwali Solution
Here is superman Celebrates Diwali problem solution - https://programs.programmingoneonone.com/2021/07/hackerrank-superman-celebrates-diwali-problem-solution.html
I don't understand what input/output logic expected. Every previous task provides function name and parameters. Here we don't have anything
typical dp problem with some tricky manipulation. Here is my python solution:
import java.io.IOException; import java.io.InputStream;
public class Solution {
int[][] people = new int[N][H]; for (int n=0; n
} int[][] save = new int[N][H]; int[] max = new int[H]; for (int n=0; n
} for (int h=1; h= I) { value = Math.max(value, max[h-I]);
} value += people[n][h]; maxPeople = Math.max(maxPeople, value); save[n][h] = value; } max[h] = maxPeople;
} int answer = 0; for (int n=0; n
}