Activity for rak1507
Type | On... | Excerpt | Status | Date |
---|---|---|---|---|
Comment | Post #281956 |
To be honest I think it should really be able to handle any positive integer, should have maybe had a test case for that. (more) |
— | over 3 years ago |
Comment | Post #282081 |
This doesn't seem to give the right answers
(more) |
— | over 3 years ago |
Comment | Post #282075 |
I'm going to be harsh and say no sorry
(more) |
— | over 3 years ago |
Edit | Post #282075 | Initial revision | — | over 3 years ago |
Question | — |
Evaluation order of an APL n-train Description APL trains are a series of functions, that get applied to an argument in this way: ``` (f g) x = f g x (f g h) x = (f x) g (h x) (a b c d e f) x = (a (b c (d e f))) x = a (b x) c (d x) e (f x) ``` Trains evaluate from the right to the left, so in the last example, (f x) is eval... (more) |
— | over 3 years ago |
Comment | Post #281956 |
Sorry for the late reply, sure, that's fine
(more) |
— | over 3 years ago |
Edit | Post #280646 |
Post edited: |
— | over 3 years ago |
Edit | Post #281956 |
Post edited: |
— | over 3 years ago |
Edit | Post #281956 |
Post edited: |
— | over 3 years ago |
Edit | Post #281956 |
Post edited: |
— | over 3 years ago |
Edit | Post #281956 | Initial revision | — | over 3 years ago |
Question | — |
Backspace an array Challenge Given an array consisting of positive integers and 0s, return it with 0s acting like backspaces. Leading backspaces do nothing, and more backspaces than elements also does nothing. Credit: A comment on this video Test Cases ``` [0,0,0,0,0,5,7] -> [5,7] [1,2,0,3] -> [1,3] [1,... (more) |
— | over 3 years ago |
Comment | Post #281943 |
Hey, welcome to the site, the answer needs to be in the given input format, so like [[0,0],[0,2],[1,0],[1,2],[2,1]] rather than like [[0, 2], [0, 2], [1]] (more) |
— | over 3 years ago |
Edit | Post #281621 | Initial revision | — | over 3 years ago |
Answer | — |
A: Juggler sequences [Jelly], 7 bytes Ḃ×½ḞµƬ ``` Ḃ×½ḞµƬ Ḃ input ^ (input % 2) ×½ multiply sqrt(input) Ḟ floor µƬ iterate until converged and collect results ``` Try it online! (more) |
— | over 3 years ago |
Comment | Post #281542 |
The strings should either be function parameters or taken from input. (more) |
— | over 3 years ago |
Edit | Post #281542 |
Post edited: |
— | over 3 years ago |
Edit | Post #281542 |
Post edited: |
— | over 3 years ago |
Edit | Post #281542 | Initial revision | — | over 3 years ago |
Question | — |
Merge two strings Challenge Given two strings a and b, return the shortest string s so that s starts with a and ends with b. (Inspired by https://chat.stackexchange.com/transcript/message/57816868#57816868 ) Examples ``` 'ABCDEF', 'EFGHI' -> 'ABCDEFGHI' 'AAAAAA', 'AAAAAAAA' -> 'AAAAAAAA' 'ABC', '123' ->... (more) |
— | over 3 years ago |
Edit | Post #281384 |
Post edited: |
— | over 3 years ago |
Comment | Post #281401 |
These don't assume that. The explanation is based on the fact this is a bit reversal permutation https://en.wikipedia.org/wiki/Bit-reversal_permutation
(more) |
— | over 3 years ago |
Edit | Post #281401 |
Post edited: |
— | over 3 years ago |
Edit | Post #281401 | Initial revision | — | over 3 years ago |
Answer | — |
A: Beaver Code Decryption Solutions by ngn https://chat.stackexchange.com/transcript/message/57690032#57690032 APL 17: `{⍵[⍋⍋⍉⊖2⊥⍣¯1⍳≢⍵]}` ngn/k 13: `{x@<<+|2\!#x}` These are too good not to post. (more) |
— | over 3 years ago |
Edit | Post #281384 |
Post edited: |
— | over 3 years ago |
Edit | Post #281384 |
Post edited: |
— | over 3 years ago |
Edit | Post #281384 |
Post edited: |
— | over 3 years ago |
Edit | Post #281384 |
Post edited: |
— | over 3 years ago |
Edit | Post #281384 |
Post edited: |
— | over 3 years ago |
Edit | Post #281384 | Initial revision | — | over 3 years ago |
Question | — |
Beaver Code Decryption Credit This challenge is taken with permission from https://www.mysterytwisterc3.org/en/challenges/level-1/beaver-code Description The encryption method is as follows: The plaintext is divided into two halves, odd positions and even positions. Example: `'CRYPTO' -> ['CYT','RPO']` Th... (more) |
— | over 3 years ago |
Comment | Post #281372 |
or +/¨⊢=,/ or my personal favourite ⊢+.=¨,\
(more) |
— | over 3 years ago |
Comment | Post #281372 |
(this as a train is my 7 byte solution)
(more) |
— | over 3 years ago |
Edit | Post #281368 | Initial revision | — | over 3 years ago |
Question | — |
Cumulative Counts Challenge Given an array of numbers return the cumulative count of each item. This is the number of times an item has occurred so far. Examples ``` [1,1,2,2,2,1,1,1,3,3] -> [1,2,1,2,3,3,4,5,1,2] [3,7,5,4,9,2,3,2,6,6] -> [1,1,1,1,1,1,2,2,1,2] ``` Brownie points for beating my 7 byte AP... (more) |
— | over 3 years ago |
Comment | Post #280860 |
Nice, interested in how you figured out the explicit formula. (more) |
— | over 3 years ago |
Edit | Post #280858 | Initial revision | — | over 3 years ago |
Question | — |
Ratio limits of fibonacci-like series Definition \$F{n}\left(0\right)=0\$ \$F{n}\left(1\right)=1\$ \$F{n}\left(x\right)=n\cdot F{n}\left(x-1\right)+F{n}\left(x-2\right)\$ For example: \$F{1}=\left[0,1,1,2,3,5,8,13,21,34,55,89...\right]\$ \$F{2}=\left[0,1,2,5,12,29,70,169,408,985...\right]\$ \$F{3}=\left[0,1,3,10,33,1... (more) |
— | over 3 years ago |
Comment | Post #280650 |
Yeah, my bad, I realise now it wasn't fully thought through. (more) |
— | almost 4 years ago |
Comment | Post #280650 |
Wow! Did not expect this one to be answered so quickly. Unfortunately it seems to fail for [[0, 1, 0], [1, 0, 0], [0, 0, 0]], two lines of length 1 that are parallel diagonally. (more) |
— | almost 4 years ago |
Edit | Post #280646 | Initial revision | — | almost 4 years ago |
Question | — |
Longest parallel lines Note: This challenge was underspecified and bad, and as such I would not encourage answering it in the future. Challenge You will be given a single 2D boolean array \$M\$. You may take its dimensions as a separate argument if needed. Find the longest parallel lines in the matrix. Parallel... (more) |
— | almost 4 years ago |
Edit | Post #280637 | Initial revision | — | almost 4 years ago |
Answer | — |
A: Write a Deadfish Interpreter [APL (Dyalog Classic)], 47 bytes i←+∘1⋄d←-∘1⋄s←×⍨⋄o←⎕∘←⋄{}{0⌈a×256≠a←⍎⍕⍺,⍵}/⌽0,⍞ Try it online! (more) |
— | almost 4 years ago |
Edit | Post #280597 | Initial revision | — | almost 4 years ago |
Answer | — |
A: Truthify an array [APL (Dyalog Extended)], 1 byte ⍸ ¯\\(ツ)/¯ Try it online! (more) |
— | almost 4 years ago |