Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

modify a noda.pl

  • Loading branch information...
commit 68e34e9c0221a9bed7469aef9dcbfdf795bd8eed 1 parent cfe5d6e
@libitte authored
Showing with 13 additions and 7 deletions.
  1. +13 −7 noda.pl
View
20 noda.pl
@@ -74,12 +74,18 @@ sub get_max_pair {
return $max_pair;
}
-sub sum {
- my @s = @_;
- my $ret = 0;
- for (@s) {
- $ret += $_;
- }
- return $ret;
+sub _max {
+ my ($n) = @_;
+ my @ns = sort { $b <=> $a } @$n;
+ return shift(@ns);
}
+#sub sum {
+# my @s = @_;
+# my $ret = 0;
+# for (@s) {
+# $ret += $_;
+# }
+# return $ret;
+#}
+
Please sign in to comment.
Something went wrong with that request. Please try again.