The Haunted House

One night, a group of friends decided to take a stroll through the forest. Suddenly they realized th…

Click here to read the complete problem statement.


If you need help solving this problem, mention your approach and ask specific questions. Please avoid sharing your code and asking the Community to figure out “what’s wrong”.

@hjr265
Unwanted whitespace characters in the problem testcases.
Codes do not work in Python3 unless I use strip()

1 Like

Thanks @touhidur!

The test cases had CRLF line endings. This has been fixed now.

DONT USE PYTHON FOR competitive programming. Its supper slow.

I agree, it’s quite slower than most of the other languages.
But, Python is a bit higher-level than some of the languages.

Some of the the advantages of Python are-

  • It’s easy to learn and code with Python.
  • The code readability is better than the other languages.
  • The syntax is more English-like.
  • Good for areas like data science, where codes tend to be very long.

But a bad disadvantage of Python is its sluggish speed.
Using compiled languages without garbage collection like C, C++, Rust etc. is better for solving problems where time is a concern. I personally use C/C++ for those problems.

1 Like