views:

98

answers:

1

For example, given 1 8 4 9 0 2 , return 3. Thanks.

+5  A: 
  {⍬⍴(⍳1+⍴⍵)~⍵} 1 8 4 9 0 2

3

Thanks, but I can't read the presumabley APL font. Can you post it in psuedo code?
first(iota 1 plus shape arg)without arg
Thanks! That's genious. No matter what the magnitude of the given integers are, the answer must be less than 1 plus the count. Very nice.