[your code here]

drug drug2004 at bk.ru
Thu Apr 29 13:49:49 UTC 2021


29.04.2021 15:26, Timon Gehr пишет:
> On 28.04.21 15:21, drug wrote:
>> 28.04.2021 15:34, Paul Backus пишет:
>>> 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;
>>> ```
>>
>> it's better alternative!
> 
> 
> ```d
> .count!(pair => gcd(pair[0], pair[1]) == 1);
> ```

it's the best! :)


More information about the Digitalmars-d mailing list