1 / 5
Jan 2018

Can someone please explain the problem? I’ve been trying for an hour to understand the problem, but I’m unable to even understand what they’re asking us to do!

Edit : Could someone explain one of the test cases? I’ll try to solve the problem if I understand at least one test case. Thank You.

  • created

    Jan '18
  • last reply

    Jan '18
  • 4

    replies

  • 845

    views

  • 2

    users

  • 1

    like

  • 1

    link

Maybe this link will be helpfully? Maybe you can faind it in your native language.

Yes, I understood what Matryoshka dolls are… but I still find the question very confusing. Could please explain one of the test cases? If I understand at least one test case, I’ll try solving the problem.

For each test case there should be one line of output containing the minimum
number of nested dolls possible.

20 30 40 50 30 40
20 < 30 < 40
30 < 40 < 50
answer 1 doll [from 3 dolls]

20 30 10 10 30 20 40 50
for example
one doll
10 < 20
10 < 30
two doll
30 < 40
20 < 50
ans: 2 dolls [each from 2 dolls]

10 30 20 20 30 10
one
10
30
two
20
20
tree
30
10
ans 3 dolls

10 10 20 30 40 50 39 51
for example:
one
10 < 20 < 40
10 < 30 < 50
two
39
51
ans: 2 dolls [first 3 dolls, second one doll]

Thanks a lot! I understood the problem perfectly. I’ll try solving - and get the answer hopefully :slight_smile: