Last active
July 22, 2025 20:29
-
-
Save justin2004/b7b934f8d6f757c4c0748396cd002163 to your computer and use it in GitHub Desktop.
bit mask over interior chars (of words)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # APL | |
| v←'RAFT DATA PLATFORM' | |
| f←1∘⌽⍤(0 0∘,)⍤(' '∘(3∧/≠)) | |
| f v | |
| 0 1 1 0 0 0 1 1 0 0 0 1 1 1 1 1 1 0 | |
| ⍉v(,⍤0)f v | |
| R A F T D A T A P L A T F O R M | |
| 0 1 1 0 0 0 1 1 0 0 0 1 1 1 1 1 1 0 | |
| # python | |
| >>> s = "RAFT DATA PLATFORM" | |
| >>> [int(0 < i < len(w)-1) for w in s.split() for i in range(len(w))] | |
| [0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment