Indeed onsite coding question
Difficulty: EASYCategory: InterviewExperienceFrequency: 1Asked On 2022-07-01Added By Anonymous
Source: Link
Company: Indeed
Role: unknown
Stage: Onsite
Location: unknown
Year: unknown
Original Post:
Coding
def cost(root, num_cores):
# you have limition like only can run num_cores task same time, for example num_cores = 2
0-3 10
0-4 16
then
0-5 (0-3)10 + 10 = 20
5-1 25
then
5-6 (5-1) 25 + 2 = 27
6-10 29
how to coding ?
Role: unknown
Stage: Onsite
Location: unknown
Year: unknown
Original Post:
Coding
def cost(root, num_cores):
# you have limition like only can run num_cores task same time, for example num_cores = 2
0-3 10
0-4 16
then
0-5 (0-3)10 + 10 = 20
5-1 25
then
5-6 (5-1) 25 + 2 = 27
6-10 29
how to coding ?