Please give the solution of samsung hiring challenge

I am not able to solve the questions of Samsung hiring challenge. But I want to know the solution of the problem. They did not provide any editorial or to see others successful submissions. Anyone who got AC in contest please give me the solution .

I only have a copy of 2nd and 3rd question.Here it is
https://drive.google.com/open?id=1OCQYNdCvKWPzCOKE_UZ1e79HQvvWl8hf

Well I solved First Problem And I will explain it if u want.And I am interested In second and 3rd solution.So plzz sm1 tell me

i don’t have question.can you give me question of samsung hiring challenge??

Solution of the first question: https://ide.geeksforgeeks.org/rXUpQihfjo

2nd Question.

First preprocess sum of all n$^2$ subarrays.

dp*[j] represents max value by dividing first i elements into j subarrays.
you can calculate as

dp*[j]=max$_{k=1\ to\ i-1}$(dp[i-k][j-1]+sum[i-k+1]).
Here sum
[j] means sum of all elements from i to j.

There are O(n*k) dp states and each state computed in O(n) time.

Time O(n$^2$k)
Space O(nk)

Anybody got an email for samsung onsite test? I wanted to know if that mail is the result of the online hiring challenge or something random. The center is quite far from my place, so I want to know if the trip would be worth the trouble.

can you please explain 1st? I was able to get 48 in that… I will explain 2nd in a comment soon.

I add the question link .

https://www.quora.com/Using-Java-how-do-you-find-the-length-of-the-largest-sub-array-where-the-first-element-of-this-array-is-greater-than-or-equal-to-the-last-element-of-that-sub-array

this two link will help you for 1st question.
please help me for 2nd .

Not clear to me. How I get maximum sum of odd times appearance number for a range of K?