Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Challenges

Post History

71%
+3 −0
Challenges Multiply two strings

BQN, 3 bytes Anonymous tacit infix function, taking the second string as left argument and the first string as right argument. ⥊⌊⌜ ⌊⌜ minimum table ⥊ deshape (flatten) BQN treats characters ...

posted 2y ago by Adám‭  ·  edited 2y ago by Adám‭

Answer
#2: Post edited by user avatar Adám‭ · 2021-08-24T13:02:34Z (over 2 years ago)
  • # BQN, 9 bytes
  • Anonymous tacit infix function, taking the second string as left argument and the first string as right argument.
  • ```
  • ⥊⌊⌜
  • ```
  • `⌊⌜` minimum table
  • `⥊` deshape (flatten)
  • [BQN treats characters as an affine space](https://mlochbaum.github.io/BQN/doc/types.html#characters) which is basically a fancy name for each character being an integer (indicating the code point) and a Boolean (indicating the "characterness": 1 for character, 0 for non-character). Arithmetic on characters applies to both the code point and the characterness. Here, we take the minimum which gives the desired code point, and since both arguments are characters, the characterness stays at 1.
  • [Try it!](https://mlochbaum.github.io/BQN/try.html#code=RuKGkOKliuKMiuKMnArin6gKIyDLnCByZXZlcnNlcyBvcmRlciBvZiBhcmd1bWVudHMKIiIgRsucICIiCiIiIEbLnCAiMTIzIgoiMTIiIEbLnCAiIgoiMiIgRsucICIzIgoiNSIgRsucICI0IgoiLy8iIEbLnCAiLy8vIgoieHh4eCIgRsucICJ4eCIKIjEyIiBGy5wgIjEyMyIKIjEyMyIgRsucICJhYmMiCiJhYmMiIEbLnCAiMTIzIgoiYWJjIiBGy5wgImFiYyIK4p+p)
  • # BQN, 3 [bytes](https://github.com/mlochbaum/BQN/blob/master/commentary/sbcs.bqn)
  • Anonymous tacit infix function, taking the second string as left argument and the first string as right argument.
  • ```
  • ⥊⌊⌜
  • ```
  • `⌊⌜` minimum table
  • `⥊` deshape (flatten)
  • [BQN treats characters as an affine space](https://mlochbaum.github.io/BQN/doc/types.html#characters) which is basically a fancy name for each character being an integer (indicating the code point) and a Boolean (indicating the "characterness": 1 for character, 0 for non-character). Arithmetic on characters applies to both the code point and the characterness. Here, we take the minimum which gives the desired code point, and since both arguments are characters, the characterness stays at 1.
  • [Try it!](https://mlochbaum.github.io/BQN/try.html#code=RuKGkOKliuKMiuKMnArin6gKIyDLnCByZXZlcnNlcyBvcmRlciBvZiBhcmd1bWVudHMKIiIgRsucICIiCiIiIEbLnCAiMTIzIgoiMTIiIEbLnCAiIgoiMiIgRsucICIzIgoiNSIgRsucICI0IgoiLy8iIEbLnCAiLy8vIgoieHh4eCIgRsucICJ4eCIKIjEyIiBGy5wgIjEyMyIKIjEyMyIgRsucICJhYmMiCiJhYmMiIEbLnCAiMTIzIgoiYWJjIiBGy5wgImFiYyIK4p+p)
#1: Initial revision by user avatar Adám‭ · 2021-08-24T12:54:20Z (over 2 years ago)
# BQN, 9 bytes

Anonymous tacit infix function, taking the second string as left argument and the first string as right argument.
```
⥊⌊⌜
```

`⌊⌜` minimum table

`⥊` deshape (flatten)

[BQN treats characters as an affine space](https://mlochbaum.github.io/BQN/doc/types.html#characters) which is basically a fancy name for each character being an integer (indicating the code point) and a Boolean (indicating the "characterness": 1 for character, 0 for non-character). Arithmetic on characters applies to both the code point and the characterness. Here, we take the minimum which gives the desired code point, and since both arguments are characters, the characterness stays at 1.

[Try it!](https://mlochbaum.github.io/BQN/try.html#code=RuKGkOKliuKMiuKMnArin6gKIyDLnCByZXZlcnNlcyBvcmRlciBvZiBhcmd1bWVudHMKIiIgRsucICIiCiIiIEbLnCAiMTIzIgoiMTIiIEbLnCAiIgoiMiIgRsucICIzIgoiNSIgRsucICI0IgoiLy8iIEbLnCAiLy8vIgoieHh4eCIgRsucICJ4eCIKIjEyIiBGy5wgIjEyMyIKIjEyMyIgRsucICJhYmMiCiJhYmMiIEbLnCAiMTIzIgoiYWJjIiBGy5wgImFiYyIK4p+p)