Skip to content

2017-8: Be the First 1

Write a dfn that takes a Boolean vector or scalar and “turns off” all the 1s after the first 1.

Examples:

     (your_function) 0 1 0 1 0 0 1
0 1 0 0 0 0 0
     (your_function) ⍬ ⍝ should return an empty vector      

     (your_function) 0 0 0 0 ⍝ no 1's?  no problem!
0 0 0 0
your_function ←

Solutions

Video Thumbnail YouTube

Chat transcript Code on GitHub