Hackwithinfy round2

No sadly its not.

Consider 189979 when your right pointer is initially at the last 9, what your code is doing is removing digits from the start one by one, but that would bring you to “79”, where nothing can be done.

Optimal answer would be two use two consecutive 9’s as pivot remove pre / post occurring characters one by one and the finally the two 9’s.

189979 - 89979 - 9979 - 997 - 99 .

Hey,i got the same question and ended up wasting a lot of time thinking since it is a 50pts question there has to be an easy way to solve,i eventually moved on but i am extremely curious about the solution.Can you please share the link of the code or even a brief explanation.Thank you!

If anyone has solved amusement park, i would like to know the approach. The question was highly ambiguous.

sad! stupid hidden verdict shit.

I solved it using mutlisource BFS to find distance and then dfs to find valid point and then printed maximum distance on a valid point.

I think there is no trichy way to solve. But i think you can recure and memoization for the pair i,j which is index and for every index check min distance from one of the vendor finally return the value of i,j which is maximum from all

can you tell me whether my approach is right or not?

But due to any some minor mistake i’m found some wrong . I’m getting right in most of but still wrong in some. But at last your code is going to fail so i’m unhappy with this problem as 50. I think it will be hard for those who get this question to clear round . Or they will allow some of the place for this problem set? I dont know if anyone of you know then please clera that doubt

thats what i used bfs for, dfs to check if points are valid or not

Hmm , i try recursion and memoization

don’t worry i am pretty sure they didn’t bother making more than 5 test files

Any chances of recontest? XD

On the list of things that are never gonna happen, recontest is never gonna happen the most.

2 Likes

yeah hopefully it will pass.

btw, what was this question worth in terms of points 50 or 75?

75

right. Isn’t it really easy for some people because if there exists 99 or the string length is 1, there’s an answer. I couldn’t figure it out, but many could have, easily.

Man, I hate this no pretest setting. Just found an edge case for 50 point problem where my code fails. :frowning_face:

I am so stupid, its not even an edge case, its simple normal case for which I should have tested and code should have failed in pretests. :sob:

1 Like

Same dread and regret here bro.

I am just hoping that testcases aren’t that strong.

bro
do they hire for system specialist engineer i.e top 3000 this year
thanks in advance