I'm back to working on Advent of Code. I'm on day 4, a bit late I know.
I have "each each" in my solution which doesn't feel right to me.
Here's a reproducible case:
validCodes =:
('mvhkvbdib-kmjezxodgz-mvwwdo-omvdidib';'zydfxpc-rclop-qwzhpc-lnbftdtetzy')
validIds=: 837 171
alpha =: 'abcdefghijklmnopqrstuvwxyz'
validIds ((alpha i. ]) { alpha |.~ [) each each '-' cut each validCodes
┌──────────────────────────────────────┬──────────────────────────────────┐
│┌─────────┬──────────┬──────┬────────┐│┌───────┬─────┬──────┬───────────┐│
││rampaging│projectile│rabbit│training│││onsumer│grade│flower│acquisition││
│└─────────┴──────────┴──────┴────────┘│└───────┴─────┴──────┴───────────┘│
└──────────────────────────────────────┴──────────────────────────────────┘
Does the "each each" feel out of place? If so, how would it be eliminated?
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm