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

77%
+5 −0
Challenges Is it a near-anagram?

Stax, 12 bytes ä╫◙=♥:≡ƒélΣæ Run and debug it +3 after correcting it(thanks, HakerH) Explanation b%s%>{s}M|-%1= b copy the two inputs %s%> is the first's length...

posted 4y ago by Razetime‭  ·  edited 4y ago by Razetime‭

Answer
#2: Post edited by user avatar Razetime‭ · 2021-02-17T06:41:24Z (almost 4 years ago)
  • # [Stax](https://github.com/tomtheisen/stax), 9 [bytes](https://github.com/tomtheisen/stax/blob/master/docs/packed.md#packed-stax)
  • ▐╡«ùoÆ▓┼■
  • [Run and debug it](https://staxlang.xyz/#p=deb5ae976f92b2c5fe&i=%22ADOBE%22+%22ABODE%22%0A%22TUPLE%22+%22TULIP%22%0A%22ABCDE%22+%22DADBC%22%0A%22BAR%22+%22BARN%22%0A%22BARN%22+%22BARREN%22&m=2)
  • ## Explanation
  • ```
  • b<{s}M|-%1=
  • b copy the two inputs
  • < is the first < second?
  • {s}M if so, swap the two
  • |- multiset difference
  • % is the length of the difference
  • 1= equal to 1?
  • # [Stax](https://github.com/tomtheisen/stax), 12 [bytes](https://github.com/tomtheisen/stax/blob/master/docs/packed.md#packed-stax)
  • ä╫◙=♥:≡ƒélΣæ
  • [Run and debug it](https://staxlang.xyz/#p=84d70a3d033af09f826ce491&i=%22ADOBE%22+%22ABODE%22%0A%22TUPLE%22+%22TULIP%22%0A%22ABCDE%22+%22DADBC%22%0A%22BAR%22+%22BARN%22%0A%22BARN%22+%22BARREN%22%0A%22AC%22+%22ABC%22&m=2)
  • +3 after correcting it(thanks, HakerH)
  • ## Explanation
  • ```
  • b%s%>{s}M|-%1=
  • b copy the two inputs
  • %s%> is the first's length < second?
  • {s}M if so, swap the two
  • |- multiset difference
  • % is the length of the difference
  • 1= equal to 1?
#1: Initial revision by user avatar Razetime‭ · 2021-02-17T05:27:24Z (almost 4 years ago)
# [Stax](https://github.com/tomtheisen/stax), 9 [bytes](https://github.com/tomtheisen/stax/blob/master/docs/packed.md#packed-stax)

	▐╡«ùoÆ▓┼■

[Run and debug it](https://staxlang.xyz/#p=deb5ae976f92b2c5fe&i=%22ADOBE%22+%22ABODE%22%0A%22TUPLE%22+%22TULIP%22%0A%22ABCDE%22+%22DADBC%22%0A%22BAR%22+%22BARN%22%0A%22BARN%22+%22BARREN%22&m=2)

## Explanation
```
b<{s}M|-%1=
b           copy the two inputs
 <          is the first < second?
  {s}M      if so, swap the two
      |-    multiset difference
        %   is the length of the difference
         1= equal to 1?