Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

7
  • \$\begingroup\$ Could you show an explicit example of the input your code accepts? Say for a 2 by 2 matrix. Also, you seem to have golfed your code! (This is a fastest-code challenge, not a golf challenge.) \$\endgroup\$ Commented Mar 3, 2018 at 13:48
  • \$\begingroup\$ @Lembik For the record, as I said in chat, the input is in the same format as the examples - json (actually, it only reads the numbers and uses n=sqrt(len(input))/2). I usually write short code, even when golfing is not a requirement. \$\endgroup\$ Commented Mar 3, 2018 at 14:46
  • \$\begingroup\$ What's the largest size matrix this new code should support? \$\endgroup\$ Commented Mar 5, 2018 at 10:00
  • 1
    \$\begingroup\$ -march=native will make a big difference here. At least on TIO, it nearly cuts the wall time in half. \$\endgroup\$ Commented Mar 5, 2018 at 14:40
  • 1
    \$\begingroup\$ Also, at least on TIO, the executable produced by gcc will be even faster. \$\endgroup\$ Commented Mar 5, 2018 at 14:52