[your code here]

Q. Schroll qs.il.paperinik at gmail.com
Thu Apr 29 14:33:06 UTC 2021


On Wednesday, 28 April 2021 at 12:34:51 UTC, Paul Backus wrote:
> On Wednesday, 28 April 2021 at 07:56:50 UTC, drug wrote:
>> ```D
>>         .map!((a)=>(gcd(a[0], a[1]) == 1) ? 1 : 0)
>>         .sum(0);
>> ```
>
> Alternatively:
>
> ```d
> .filter!(pair => gcd(pair[0], pair[1]) == 1)
> .count;
> ```

```d
.filter!(pair => pair.expand.gcd == 1)
```

Not sure if it's trolly or more elegant.


More information about the Digitalmars-d mailing list