You are not logged in. Please login at www.codechef.com to post your questions!

×

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

asked 13 Aug '18, 21:32

soumya_98's gravatar image

3★soumya_98
11
accept rate: 0%

edited 16 Aug '18, 20:22


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

link

answered 13 Aug '18, 22:08

khiljee's gravatar image

1★khiljee
393
accept rate: 0%

edited 13 Aug '18, 22:10

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

(13 Aug '18, 23:51) beardaspirant3★

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

link

answered 13 Aug '18, 22:10

sna902055's gravatar image

5★sna902055
425
accept rate: 7%

I add the question link .

(16 Aug '18, 20:23) soumya_983★

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

link

answered 16 Aug '18, 22:01

sushilverma's gravatar image

4★sushilverma
111
accept rate: 0%

2nd Question.

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

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

dp[i][j]=max$_{k=1\ to\ i-1}$(dp[i-k][j-1]+sum[i-k+1][i]). Here sum[i][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)

link

answered 17 Aug '18, 04:11

praveenkumar12's gravatar image

5★praveenkumar12
29819
accept rate: 8%

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

(17 Aug '18, 18:40) soumya_983★

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.

link

answered 31 Aug '18, 14:16

sikander_nsit's gravatar image

5★sikander_nsit
1.5k82130
accept rate: 0%

toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:

×858
×39

question asked: 13 Aug '18, 21:32

question was seen: 503 times

last updated: 31 Aug '18, 14:16