2020.11.12 01:35 PM
2020.11.13 01:15 AM
2020.11.13 01:31 AM
2020.11.13 11:32 AM
I imagine that your solution is the one that most people would use in practice.For the sake of variety:q){x where d&1_(d:differ x),1b}asc 1 2 4 5 7 9 2 2 51 4 7 9Sort the list then if an entry is different from the previous entry and different to the next it's unique.Terry
2020.11.14 04:02 AM
2020.11.16 01:59 PM
2020.11.16 06:21 PM
2020.11.17 01:10 AM
2020.11.17 01:42 AM
2020.11.17 04:02 AM
2020.11.17 04:47 AM
q)\ts:100 {d:distinct x; d where (x?d)=(-1+count x)-reverse[x]?d}l
131 1442672
q)\ts:100 {d where 1i=@[count[d]#0i;(d:distinct x)?x;+;1i]}l
113 1770528
2020.11.17 07:05 AM
EMEA
Tel: +44 (0)28 3025 2242
AMERICAS
Tel: +1 (212) 447 6700
APAC
Tel: +61 (0)2 9236 5700
KX. All Rights Reserved.
KX and kdb+ are registered trademarks of KX Systems, Inc., a subsidiary of FD Technologies plc.