Perl Monk, Perl Meditation | |
PerlMonks |
Re^4: Fast Way to Return Unique Array of Arrayby pg (Canon) |
on Sep 05, 2005 at 04:23 UTC ( [id://489138]=note: print w/replies, xml ) | Need Help?? |
No, your program does not return the correct answer all the time. The problem is that your code would not work with data that contains ','. Testing is not to prove one's code is correct, but rather to find out the exceptions. There is no problem with my input. By readng your code, I knew that it would fail if the data contains ',', as your program first concat elements with ',', and then split by ','. When the data contains ',', the problem arises, as:
You cannot say that the input is wrong, because your code cannot handle it. In this thread, the correct solutions should be able to handle any two dimentional AoA. Your program does not satisfy this. Your code is not bad, but it certainly can be better.
In Section
Seekers of Perl Wisdom
|
|