2017-8: Be the First 1

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

Examples

Implementation

You can also run the tests via ⌘/shift + enter