#coding challenge

8 messages · Page 1 of 1 (latest)

naive tusk
#

Failed for this coding challenge who can explain and give me a solution

dire valeBOT
#

This post has been reserved for your question.

Hey @naive tusk! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

half linden
#

i hate array ngl

naive tusk
half linden
#

too advance for me sorry

abstract ginkgo
#

Compare all the ranges with all other ranges (n < 10^5, so it should comfortably fit under 1 second). At each iteration try to put the current element into the next available group (let's start with group 1) and each that overlaps. Whenever the current range doesn't overlap with anything else put it into group 0. If it overlaps with a range that has a group assigned record it to some kind set or something. After that use collected data to merge groups that you have to a minimal set. After that it's 2^(x+y) mod 10^9 + 7 where x is a number of indepndent groups and y is a number of elements in group 0.

#

At least that's what I think. I'll take a second look at that later.