this one is bugging me. as part of the one challenges, i need a J phrase for "the index of the first element in the list which has been seen before." the best i came up with was `1 i.~ ({: e. }:)\`. can anyone improve this?
@H.PWiz i need the 2nd. the 2nd occurence is "the first element which has been seen before." on the first occurence, it hasn't been seen yet so it doesn't count.
Another splinter in my mind has been "get the most frequent element of a list". My best attempt so far: ~. {.@\: 1 #. = for 11 bytes (the spaces can be removed). It feels like this one should be more concise in J but I've hacked at it for a while and can't get it down...
Since there is a bound left argument '/\', the train must be called dyadically.
So the right tine (single one of a fork's three pointy tips) is ,⍨ so it appends the left arg '/\' to the main right arg (which is always a single character due to ¨).