How to Fix Hidden Errors in My Code Submission?

0
5
Asked By CuriousCoder92 On

I'm really struggling with an issue in my program. I submitted it to an online coding platform and only scored 15 out of 30. I'm getting an abort error, and I can't seem to identify the hidden issues since the test cases aren't visible to me. My code seems correct to me. Can anyone help me understand how to deal with these elusive errors, especially when I can't see what's causing the problem? Thanks a lot!

3 Answers

Answered By CPlusPlusGuru On

There are some real issues with your code structure. For one, initializing an array like that isn't safe in C++. You should use a `std::vector` instead of a fixed-size array. Also, avoid using `#include `, it's generally considered bad practice.

Answered By CodeWhisperer77 On

It looks like you might have a problem with how you're checking for the pattern in the grid. If the first line of the pattern appears multiple times in the search grid, your current logic won't handle that properly.

TechieThoughts -

Good point! You might want to add conditions to check all instances instead of just the first.

Answered By HelpfulHacker On

Don't worry too much! It's common to miss some edge cases. Try adding more debug outputs to see how your program behaves with different inputs. It might help you uncover where it's failing.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.