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

66%
+2 −0
Challenges Truthify an array

Japt -m, 8 7 bytes ð òÎmiV Try it ð òÎmiV :Implicit map of each sub-array at 0-based index V ð :Indices of truthy (i.e., non-zero) elements ò :Partition between eleme...

posted 3y ago by Shaggy‭  ·  edited 2y ago by Shaggy‭

Answer
#3: Post edited by user avatar Shaggy‭ · 2021-10-01T14:48:28Z (over 2 years ago)
  • # [Japt](https://github.com/ETHproductions/japt), 8 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
  • Ëð òÎmiE
  • [Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&code=y/Ag8s5taUU&input=W1sxLDAsMV0sWzEsMCwxXSxbMCwxLDBdXQotUQ)
  • Ëð òÎmiE :Implicit input of 2D-array
  • Ë :Map each D at 0 based index E
  • ð : Indices of truthy (i.e., non-zero) elements
  • ò : Partition between elements where
  • Î : The sign of their difference is truthy
  • m : Map
  • iE : Prepend E
  • # [Japt](https://github.com/ETHproductions/japt) [`-m`](https://codegolf.meta.stackexchange.com/a/14339/), <s>8</s> 7 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
  • ð òÎmiV
  • [Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&flags=LW0&code=8CDyzm1pVg&input=W1sxLDAsMV0sWzEsMCwxXSxbMCwxLDBdXQotUQ)
  • ð òÎmiV :Implicit map of each sub-array at 0-based index V
  • ð :Indices of truthy (i.e., non-zero) elements
  • ò :Partition between elements where
  • Î :The sign of their difference is truthy
  • m :Map
  • iV : Prepend V
#2: Post edited by user avatar Shaggy‭ · 2021-06-22T16:50:31Z (almost 3 years ago)
  • # [Japt](https://github.com/ETHproductions/japt), 8 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
  • Ëð ó miE
  • [Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&code=y/Ag8yBtaUU&input=W1sxLDAsMV0sWzEsMCwxXSxbMCwxLDBdXQotUQ)
  • # [Japt](https://github.com/ETHproductions/japt), 8 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
  • Ëð òÎmiE
  • [Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&code=y/Ag8s5taUU&input=W1sxLDAsMV0sWzEsMCwxXSxbMCwxLDBdXQotUQ)
  • Ëð òÎmiE :Implicit input of 2D-array
  • Ë :Map each D at 0 based index E
  • ð : Indices of truthy (i.e., non-zero) elements
  • ò : Partition between elements where
  • Î : The sign of their difference is truthy
  • m : Map
  • iE : Prepend E
#1: Initial revision by user avatar Shaggy‭ · 2021-06-14T16:13:06Z (almost 3 years ago)
# [Japt](https://github.com/ETHproductions/japt), 8 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)

    Ëð ó miE

[Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&code=y/Ag8yBtaUU&input=W1sxLDAsMV0sWzEsMCwxXSxbMCwxLDBdXQotUQ)