one year old's thread for which there were proper
> replies here -
> https://www.nntp.perl.org/group/perl.beginners/2017/05/msg126502.html and here
> - https://github.com/shlomif/project-euler/tree/master/project-euler/8 . just
> let sleeping dogs rest. Some comments on your code:
&
Hi,
why did you resurrect a one year old's thread for which there were proper
replies here -
https://www.nntp.perl.org/group/perl.beginners/2017/05/msg126502.html and here
- https://github.com/shlomif/project-euler/tree/master/project-euler/8 . just
let sleeping dogs rest. Some comments on
On Tue, 2017-05-16 at 14:01 +0800, derr...@thecopes.me wrote:
I am working on problem #8 of the euler project. see below.
>
>
>
> The four adjacent digits in the 1000-digit number that have the
> greatest product are 9 × 9 × 8 × 9 = 5832.
>
> 73167176531330624919225119674426574742355349194934
Shlomi Fish writes:
> Hi lee,
>
> I decided to try to give you another chance to be educated, despite Uri's
> conclusion in the other thread. Hopefully you won't let me down.
He has made a lot of conclusions and decided not to say anything
further. I know it can be difficult to convince me of s
Hi lee,
I decided to try to give you another chance to be educated, despite Uri's
conclusion in the other thread. Hopefully you won't let me down.
On Thu, 25 May 2017 16:48:13 +0100
lee wrote:
> Shlomi Fish writes:
>
> > [...]
> >> >> while ( my $numbline = ) {
> >> >> chomp $numbline;
Shlomi Fish writes:
> [...]
>> >> while ( my $numbline = ) {
>> >> chomp $numbline;
>> >> my @numbline = split //, $numbline;
>> >
>> > You're processing the input number line-by-line, but it's one whole number
>> > and the products may span across more than one line. You need to slurp
Hi lee!
On Thu, 25 May 2017 02:24:05 +0100
lee wrote:
> Shlomi Fish writes:
>
> > Hi all!
> >
> > Resending because the original message does not appear to have arrived at
> > the list.
> >
> > =
> >
> > Hi Derrick,
> >
> > On Tue, 16 May 2017 14:01:34 +0800
> > derr...@thecopes.me wrote:
Ok, here's one more:
[...]
unless($ad) {
print " * $ad = 0\n";
$start = $digit;
next DIGITS;
}
[...]
You can skip right away to behind the 0 which has already been found
within the current range of adjacency.
lee writes:
> Sorry, I was too fast and I got
Sorry, I was too fast and I got it all wrong. It goes like this:
[...]
my $adjacency = 13;
my $maxprod = 0;
my $start = 0;
my $exceed = length($data);
my $end = $exceed - $adjacency;
DIGITS:
while($start < $end) {
my $prod = substr($data, $start, 1);
print $prod;
if($prod) {
my $ad
Shlomi Fish writes:
> Hi all!
>
> Resending because the original message does not appear to have arrived at the
> list.
>
> =
>
> Hi Derrick,
>
> On Tue, 16 May 2017 14:01:34 +0800
> derr...@thecopes.me wrote:
>
>> Hi All,
>>
>> I am working on problem #8 of the euler project. see below.
>>
On Tue, 16 May 2017 17:53:17 +0800
"derrick" wrote:
> OK thanks, I understand now. I was reading 20 50-digit numbers rather than 1
> 1000-digit numbers. I knew it a fundamental misunderstanding somewhere. Thank
> you again,
>
You're welcome!
-- Shlomi
> Derrick
>
> --
OK thanks, I understand now. I was reading 20 50-digit numbers rather than 1
1000-digit numbers. I knew it a fundamental misunderstanding somewhere.
Thank you again,
Derrick
--发件人:Shlomi
Fish日 期:2017年05月16日 16:54:39收件人:抄
送:Beginn
Hi all!
Resending because the original message does not appear to have arrived at the
list.
=
Hi Derrick,
On Tue, 16 May 2017 14:01:34 +0800
derr...@thecopes.me wrote:
> Hi All,
>
> I am working on problem #8 of the euler project. see below.
>
>
> I have the below solution below for thi
What if you have not 1000 but 10-digit number, and you are asked to find
max product of 4 adjacent digits.
What answer will output your program for this test case:
11199
99111
Hi All,
I am working on problem #8 of the euler project. see below.
The four adjacent digits in the 1000-digit number that have the greatest
product are 9 × 9 × 8 × 9 = 5832.
73167176531330624919225119674426574742355349194934
96983520312774506326239578318016984801869478851843
8586156078911294
15 matches
Mail list logo