# WA in WSITES01(Blocked Sites)

I solved the question using trie and set, however got WA on two cases in subtask 2. Here is the solution. If someone could point out the error or provide certain test case(s), it would be great help. Thanks in advance.

input:

``````4
+ googld
- goog
``````

output:

``````-1
``````
1 Like

https://www.codechef.com/viewsolution/13633491

i am getting WA in two test case …plz help me …

@hikarico
Why isnt the answer for the above test case “googles”?

I am getting WA.Can anyone post what is wrong in my solution.Here is my solution.If someone could point out the error or provide certain test case(s), it would be great help. Thanks in advance.

can you please check mine … its passing all the above test cases … please let me know where it went wrong.
i made two seperate arrays for blocked and unblocked and then solved this one…
[solution][1]
[1]: https://www.codechef.com/viewsolution/13588774
(sorry i cant post a question yet… so asking here)

My code passes all cases except 2. Can someone please explain what i have done wrong. I used a very naive approach of sorting the strings and applying binary search to find the closest +ve string …
my_solution: https://www.codechef.com/viewsolution/13495612

Hi I have tried a lot … but 2 TCs area failing…
https://www.codechef.com/viewsolution/14405914
I checked all the below TCs all are passing . Could somebody please help me in this…

//If all positive strings Output should be : 0

``````4
+ abcd
+ abcdchef
+ zzyy
Output
0
``````

//// all negative

``````5
- abcdchef
Output :
3
a
g
y
/// show strings in sorted order
6
+ googld
- googlds
- googldr
OUTPUT :
4
googldr
googlds
//////Any mathched -ve string shorter then positive
4
+ googld
- goog
OUTPUT :
-1
////Any mathched +ve string Longer then negative
3
- goog
OUTPUT :
-1
``````

//same string

``````2
- abc
+ abc
OUTPUT
-1``````

I misunderstood the question. Thanks!

If you write just googles then goog will be missing.

@devilhector can you explain me if you understood the above test case.
Even I have those 2 test cases wrong.

You need to block all minuses. Answer is -1 because there’s no way to block `goog` without blocking `google` and `googld`

input

``````3
+ googld
``````

output should be

``````1
``````

but you’re outputing

``````1

1 karma users can ask questions here-