Conversation started Oct 20, 2021 at 12:03.
Oct 20, 2021 12:03
*taps mic*
Right now is supposed to be the BMG
but there's no drafts in the room
so I'm taking over this one time with AI generated CMCS
Welcome to the 12th Biweekly Mini Golf. During this event, I'll post some AI-generated CMCs (Chat Mini Challenges) for you all to solve. This'll probably last 30 minutes, maybe less, idk.
6
AICMC: Given any positive integer, return the list of digits in its binary representation
AICMC: Given a positive integer, write numbers from it (largest to smallest) forming an arithmetic sequence with the difference of 3.
AICMC: Given two sorted arrays A and B of size m & n respectively (the intersection should be ignored). Return an array C containing elements common to A and B
@lyxal yeah, I think they started with sticky and whisk(e)y
@lyxal x=>x&-~x?[0,1]:[1]
AICMC: Given a list of floats [0. , .22, .25], find absolute maximum in time O(n). e.g for above array -> 0.25
AICMC: Print all primes between two numbers
AICMC: Find the smallest positive number with a sum of its digits equal to n. The result must be bigger than n
(italics means I've inserted text to make it make more sense)
@lyxal ruby, ->{_1.digits 2}
@lyxal Extended Dyalog APL:
@lyxal Vyxal: b
Oct 20, 2021 12:13
AICMC: If a word starts with 'M', return in pig latin - eg. "Monday" would convert to "Ondemay". Take care of only string alphanumeric words (don't convert   etc.)
(not really an) AICMC: You’re investigating sshd logins in your company's infrastructure when you find out that two unauthorized ssh logins occurred just recently. The last time you run your script, there were five unauthorized attempts from the IP address "127.0.0.1"
@lyxal ruby, ->{_1&_2}, or :& if implicit to_proc is allowed
AICMC: Given n distinct integers, count the frequencies of those from 0 to 10
@lyxal Extended Dyalog APL: -∘0 3…0⍨ Try it online!
AICMC: Given a set of characters (A, B), return all possible strings made from those chars.
@lyxal APL: (not sure what the parenthesis is trying to say).
Oct 20, 2021 12:20
General rule of thumb for AICMCs: answer in a way that makes the most sense to you
@lyxal Ruby, require'prime';->a,b{Prime.take(b).filter{a<_1&&_1<b}}, exclusive
@lyxal APL: ¯1+10↑⊢∘≢⌸(⍳10),⎕ Try it online!
Looks like there's a draft in the BMG draft room after all:
in BMG Drafts, Oct 5 at 23:48, by DLosc
Draft: Given a word composed of lowercase ASCII letters, reverse the order of the vowels (aeiou) within it. Examples: code -> cedo; bureaucracy -> baruaecrucy; subtraction -> sobtrictaun
@lyxal Vyxal: r'æ
@lyxal APL: ⌈/|
@lyxal APL: ⌽@(∊∘'aeiou') Try it online!
Oct 20, 2021 12:28
AICMC: Print all permutations of a string
AICMC: From integer 0 to N print all integers that cannot be represented as N^x, where x is any integer.
AICMC: Reverse the bits of an integer, example 1357 ==> 10101001 (please note that the example given is most likely incorrect, as it was AI gen'd)
@lyxal Extended Dyalog APL: ⌽⊤ or ~⊤ depending on interpretation.
Reverse as in swap (), or reverse as in NOT (¬)?
@AaroneousMiller as in reverse order (overdot R)
AICMC: A palindromic number which is the sum of 3 consecutive square numbers.
@lyxal are duplicates allowed?
can we assume we're given at least 2 characters? otherwise my code breaks
@pxeger I'll say yes, if it's convenient for you
13 mins ago, by lyxal
General rule of thumb for AICMCs: answer in a way that makes the most sense to you
Oct 20, 2021 12:34
@lyxal Vyxal: bṘ
@lyxal I think this works: Enumerator.new{|r|gets;a,m=[""],->{a=a.flat_map{|s|$_.chars.map{|c|s+c}}};loop{a.map{r<<_1};m[]}} (ruby, enumerator)
AICMC: Given a sequence of integers, print the length and sum of its longest increasing subsequence.
@lyxal APL: 1~⍨⍳ with 0-based indexing (no numbers in the range 0…N can be represented as Nˣ except 1, which is N⁰)
Then maybe this'll be a bit more challenging ;p
AICMC: You are given a positive integer N. Output all semiprimes in range [1,N](both inclusive)
@Wezl example usage: echo -n yes | ruby -e 'puts Enumerator.new{|r|gets;a,m[""],->{a=a.flat_map{|s|$_.chars.map{|c|s+c}}};loop{a.map{r<<_1};m[]}}.take(100)'
Oct 20, 2021 12:39
AICMC: Given a list of integers, remove the smallest possible number of elements such that all remaining numbers are even. (Essentially, remove all odd numbers)
very nice
and to wrap up the CMC posting, three final AICMCs:
AICMC: Given a non-empty array of integers, every element appears twice except for one. Find that single one
AICMC: Write a function that finds the largest product between three integers in any given array
@lyxal oops replied to the wrong message lol
@lyxal dzaima/APL: ⊢⌿⍨2| Try it online!
AICMC: Given a list of integers, check whether there's one integer that occurs an odd number of times.
that's all the CMCs I'll post for this event
y'all are obviously free to continue solving them
Oct 20, 2021 12:44
@lyxal Dyalog APL 18.0+: {⍵~⍵/⍨~≠⍵}
 
Conversation ended Oct 20, 2021 at 12:44.