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.

3
  • 7
    $\begingroup$ 100-Total[your_array_here,{2}] $\endgroup$ Commented May 26, 2020 at 4:45
  • 1
    $\begingroup$ @ciao: Very cute solution! Thanks. $\endgroup$ Commented May 26, 2020 at 5:08
  • 3
    $\begingroup$ @Garfield it is not just cute though: it is lightning-fast too! It is pretty much guaranteed to beat any Map based solution by orders of magnitude in execution time. Of course you could generalize it as Length[array] - Total[array, {2}]. $\endgroup$ Commented May 26, 2020 at 5:19