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


how to solve MARVEL BOX?

problem link. Can someone please share their approach.

asked 11 Oct, 07:46

pk301's gravatar image

accept rate: 16%

edited 11 Oct, 18:04

there are only 2 cases possible



for 1st:

so lets just go through all possible x,

find number of ways such that a+b+c=x,lets say it is val

so ans of first type ans1=((no.of.x)C3)*val

for 2nd:

lets just go through all possible x,

find number of ways of ways of choosing 4 numbers a,b,c,d such that ((a+b)=x and (c+d)=x) or ((a+c)=x and (b+d)=x) or ((a+d)=x and (b+c)=x)

let this be val3

so ans of second type ans2=((no.of.x)C2)*val2


try thinking of some dp for val,val3.....

(11 Oct, 22:44) vivek_19982996★

can you explain the dp states? I tried but didn't get it :(

(19 Oct, 20:44) pk3013★
toggle preview

Follow this question

By Email:

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



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "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:


question asked: 11 Oct, 07:46

question was seen: 88 times

last updated: 19 Oct, 20:45