No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
4 Posted Topics
Java Code provide by cgeier for leap year is really impressive. It is very short and yet effective. I totally agree with him.
There is a much more simpler approach to the Palindrome problem. I would suggest using StringBuffer in place of String, it provides many effective methods like reverse(). This method automatically reverses the String we need to reverse and then compare. Check out SNIP for more info on this type of …
Just add the strings in a TreeSet. All the Strings will be automatically sorted alphabetically. You may check SNIP for more details on it. Though the code here is for numbers, it applies the same for Strings.
Use the following code, after you take the value in your array TreeSet ts = new TreeSet(); for(int i = 0; i < value.length; i++) { ts.add(value[i]); } the numbers will be automatically sorted. Pick the first and last number as the max and min numbers required. Check out SNIP …
The End.
amitrail