JOIN
Get Time
forums   
Search | Watch Thread  |  My Post History  |  My Watches  |  User Settings
View: Flat  | Threaded  | Tree
Previous Thread  |  Next Thread
What's wrong with this Java solution (div2 250)? | Reply
Check out the code here. A C++ counterpart passed the system testing (simply replace files.length with files.size()), that's weird. Perhaps I missed some nuance.
Re: What's wrong with this Java solution (div2 250)? (response to post by hacker007) | Reply
You shouldn't use == to compare strings with java. Use equals instead
Re: What's wrong with this Java solution (div2 250)? (response to post by EriKKo) | Reply
Thanks for the quick reply, I almost forget this trap. However, on my local machine, it got the correct answer for test case {"..", ".", "Image.jpg"}.
Re: What's wrong with this Java solution (div2 250)? (response to post by hacker007) | Reply
Use
{new String(".."), new String("."), new String("Image.jpg")}
and you should see the same results as the system tester.
RSS