Skip to content

2017-9: Double Trouble

Write a function that takes a character vector or scalar and returns a Boolean vector indicating anywhere an element is followed by an element of the same value.

Examples:

     (your_function) 'bookkeeper'
0 1 0 1 0 1 0 0 0 0  
     (your_function) ''  ⍝ should return an empty vector      

     (your_function) 'aaaaaa'
1 1 1 1 1 0
     (your_function) 'd'
0 
your_function ←

Solutions

Video Thumbnail YouTube

Chat transcript Code on GitHub