Skip to content

2022-3: Uniquely Qualified

Write a function that:

  • takes right and left arguments that are arrays of arbitrary rank, depth, and value.
  • returns a vector of all elements that appear in either of the two argument arrays but not in both. The order of elements in the result is not significant.

Hint: The without function X~Y could be helpful.

Examples:

      'DYALOG' (your_function) 'APL'
DYOGP

      'DYALOG'  (your_function) ⊂'APL'
┌─┬─┬─┬─┬─┬─┬───┐
│D│Y│A│L│O│G│APL│
└─┴─┴─┴─┴─┴─┴───┘

      (2 2⍴'Hello'(⊂'World')(2 2⍴⍳4)42) (your_function) 42 'Have a nice day'
┌─────┬───────┬───┬───────────────┐
│Hello│┌─────┐│1 2│Have a nice day│
│     ││World││3 4│               │
│     │└─────┘│   │               │
└─────┴───────┴───┴───────────────┘

      1 1 1 (your_function) 2 2
1 1 1 2 2
your_function ←

Solutions

Video Thumbnail YouTube

Chat transcript Code on GitHub