Please read the new rule regarding the restriction on the use of AI tools. ×

saketkumarsingh's blog

By saketkumarsingh, history, 14 months ago, In English

Can someone tell the approach for this interesting question: Question

  • Vote: I like it
  • +4
  • Vote: I do not like it

»
14 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Correct me if I'm wrong. My first thought for this problem was dp. dp(i) -> maximum posters till i th element in some defined order that works (maybe sort using x and y?) but soon became doubtful if such an order even exists. For all 2 pairs we can find if the 2 posters are overlapping or not. If we create a graph and add edge b/w 2 nodes (posters) if they are NOT overlapping, then we need to find the largest connected component size which is completely connected (edge b/w every pair #E=n(n-1)/2)

  • »
    »
    14 months ago, # ^ |
      Vote: I like it +10 Vote: I do not like it

    this is a matching problem , it kinda makes sense that no greedy/dp algorithm would work even if you didnt knew the tags tho.Most of the time if it is a problem about selecting things that are limiting each other by someway and no greedy seems to work, it is a matching problem.You can learn bipartite matching algorithm and then try the problem again

»
14 months ago, # |
Rev. 5   Vote: I like it 0 Vote: I do not like it

I keep false solving