> From: "Sherlock, Ric" <[EMAIL PROTECTED]>

> 
> Well we can't have people worried about lack of forum traffic so...
> 
> I came across the following problem yesterday:
> 
> http://www.dustindiaz.com/programming-brain-teaser/
> Starting Array:
> var arr = ['a', 'b', 'c', 'c', 'd','e', 'e',
> 'e', 'e', 'e', 'f', 'e', 'f', 'e',
> 'f', 'a', 'a', 'a', 'f', 'f', 'f'];
> 
> Desired Result:
> a b c c d e e e e e f e f e f a a a f f f
> 
> In English:
> Group together all duplicate items that occur anytime beyond twice by 
> wrapping 
> them with a tag, naturally "bookending" them.
> 
> Spoiler Alert.

> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 

Here's an idea:

   3([EMAIL PROTECTED])\'abccdeeeeefefefaaafff'
0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 1 0 0 1


      
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to