4 ms·
Yes, it's ok to look. I generally don't until I've solved it, and then mostly to find hints on faster ways to solve it. Instead of hints, try asking for, or fi
by Jtsummers 11mo ago
Yes, it's ok to look. I generally don't until I've solved it, and then mostly to find hints on faster ways to solve it.
Instead of hints, try asking for, or finding, test cases. Several of us posted additional test cases that found most people's problems in part 2. Once you have a test case (with a small input size, so you can easily step through it by hand) you can usually identify the particular problems in your solution. This will also help you understand why it works.
If that still doesn't work, then find working solutions and try to understand them. Some people's solutions get really clever, don't worry about those. If it's not even remotely clear to you what's happening in it, it's not a solution you need to study yet. Find the simplest, brute force solutions first. Then find ones that look similar but are optimized in some way.