Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 92689

A competition to solve a particular problem through the usage and manipulation of arrays.

2 votes

Get the trends of an array

Vyxal, 15 bytes ¯±ĠvL1p¦2lvƒṡ‹İ Try it Online! How? ¯±ĠvL1p¦2lvƒṡ‹İ ¯ # Deltas (consecutive differences) of (implicit) input ± # Sign of each Ġ # Group conse …
naffetS's user avatar
  • 12.8k
3 votes

Add an array with itself

Vyxal, 7 bytes ẇR∆ZR∩Ṡ Try it Online!
naffetS's user avatar
  • 12.8k
2 votes

Create chunks from an array

Vyxal, 1 byte ẇ Try it Online!
naffetS's user avatar
  • 12.8k
1 vote

Add an array with itself

Desmos, 106 71 bytes l=[1...s] f(a,s)=[∑_{q=1}^{ceil(a.length/s)}join(a,l0)[qs-s+t]fort=l] -35 bytes thanks to Aiden Chow Try it on Desmos!
naffetS's user avatar
  • 12.8k
1 vote

How tall are the mushrooms?

Vyxal, 28 bytes d‹ɾ-:ż+:£₌żLÞẊ'¥¨£v"ÞfÞu;⁽G∵ Try it Online! Port of Jelly. Outputs a list of 1-indexed heights.
naffetS's user avatar
  • 12.8k
1 vote

Array Sandwiches

Vyxal, 10 bytes vẏΠ'?¨£iÞṠ Try it Online! Port of Jelly.
naffetS's user avatar
  • 12.8k
1 vote

Find ranges of True values in a list

Vyxal, 9 bytes ẏ‡?iŻv₍gG Try it Online!
naffetS's user avatar
  • 12.8k
2 votes

Cover up zeroes in a list

Vyxal, 2 bytes ɖ∨ Try it Online!
naffetS's user avatar
  • 12.8k
3 votes

Removed J-brackets

Vyxal, 14 bytes λ[ḣƛt;J,ḢƛṪ;x¤ Try it Online! Explanation λ[ḣƛt;J,ḢƛṪ;x¤ λ Open a lambda (for recursion) [ If statement (check if truthy) ḣ Separate th …
naffetS's user avatar
  • 12.8k
3 votes

Cover up zeroes in a list

Prolog (SWI), 44 bytes f(0,B,B). f(A,_,A). X*O:-scanl(f,X,0,[_|O]). Try it online!
naffetS's user avatar
  • 12.8k
4 votes

Repeat Values In Array

This two-byte solution should work, but it seems to bork when the length is an array only of zeros: Try it Online! …
naffetS's user avatar
  • 12.8k
2 votes

Repeat Values In Array

05AB1E, 2 bytes ÅΓ Try it online!
naffetS's user avatar
  • 12.8k
3 votes

Repeat Values In Array

K (ngn/k), 4 bytes ,/#' Try it online!
naffetS's user avatar
  • 12.8k
10 votes

Repeat Values In Array

Jelly, 1 byte x Try it online!
naffetS's user avatar
  • 12.8k
6 votes

Repeat Values In Array

Python 3, 42 41 40 bytes lambda*a:sum(map(lambda x,*y:x*y,*a),()) Try it online! -1 thanks to Jonathan Allan! -1 thanks to loopy walt!
naffetS's user avatar
  • 12.8k

1
2 3 4 5
15 30 50 per page