bug-apl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-apl] Performance problem with simple program


From: Elias Mårtenson
Subject: [Bug-apl] Performance problem with simple program
Date: Tue, 6 Oct 2015 13:32:37 +0800

I found the following quiz on G+, and decided to solve it with APL:

https://plus.google.com/108865431001865524379/posts/FKMrYkF6h3u

The solution I came up with was this:

      (⍳N)⍪[1.5]{+/⍎¨⊃,/⍕¨⍳⍵}¨⍳N←400

This creates a table showing the number of pages, and the sum of the digits for that number of pages.

I was surprised that the program ran so slowly, taking almost a second to finish on my (pretty fast) computer.

I'll follow up with profiler results, but I was wondering of anyone can come up with a faster solution?

Regards,
Elias

reply via email to

[Prev in Thread] Current Thread [Next in Thread]