← Back to topics
Topic

Alien Party Invites

D
Dgleich
Can someone take a look into my code and see why it gives wrong result on every test case...?
My idea was to start from index 0 on list and take names till I find N names, then I just try to cut some part of if and then update the min, then continuing adding the next but removing first and so on and when I get again N names I try to cut some part...
Code Removed...
A
Asmirasmir
Umm , i haven't done this task yet , but try to brute force the combinations for every start point , and once you find all the needed strings remember the starting and ending positions , then just search for the smallest solution. It will most probably fail on multiple testcases because of the time limit , but optimize it enough and it should pass. Try to avoid stl , or at least use the functions wisely and it should pass.
I'll try the task myself and then we will see the results :D GL with it.
D
Dgleich
Well I tryed that before and it failed on time on almost every test case...
D
Dgleich
It passed you can delete the topic.. thanks everyone...