Part of Code Golf Advent Calendar 2022 event. See the linked meta post for details.
The Elves like playing number games. One day, Bin (a friend of Fen) suggests a new game: given a positive integer n, each Elf says a number which has exactly n runs of ones in binary. The first Elf must say the s...
chatgpt thinks mpmath has a polymul function but I don’t see it documented anywhere. Does it just have better versions of the libraries that mere mortals can’t access?
This is totallly surreal “ You are correct, the mpmath library does not have a polymul() function. I must have confused it with the polymul() function from the numpy library. The mpmath library does provide support for polynomial multiplication, but it does not have a dedicated function for this purpose.”
Search space can be a fair amount smaller than that - You can only have sqrt, cbrt, 4th root, etc... At some point it becomes optimal to start searching logarithmically
CMC: Shortest regex to match a string literal which can contain escaped quotation marks (e.g. "abcdef""this is a \"string\"" should pass, "no closing mark shouldn't)
@Adám I'm confused, "pro services" implies that we, the simpleminded nonpaying plebs, don't have some super cool features that the "pros" do have, but that looks like it's offering everything already
hmm, I tried to get it to make a function to iterate over an iterable pairwise and (after importing itertools) the solution it gave me was identical to the top-voted SO answer
seeing as your "IDLE wipeout code" was so blatantly obvious a baby wouldn't have been fooled, and wouldn't have worked even if I did have the requisite lack of braincells needed to run it
@UndoneStudios except Klein does not have a SINGLE file named klein.py
I think this conversation has reached a point where continuing it really won't benefit anyone. If y'all want to continue "arguing" for some obscene reason, go to OTTNB.
Rolling a 1x1x2 block
This challenge is inspired by the game Bloxorz. Like that game, there is a 1x1x2 block, which may be moved on a square grid in any of the four cardinal directions. It moves by rotating 90 degrees about one of its edges which is touching the ground. Initially, the block is st...
Part of Code Golf Advent Calendar 2022 event. See the linked meta post for details.
Santa likes to sort his presents in a special way. He keeps "uninterleaving" the pile of presents into smaller sub-piles until each sub-pile is either full of toys or full of coal.
Your job is to, given a pile of...
I'm really not sure which I'd rather go to honestly. Carnegie-Mellon accepts way more AP tests, so I could skip like a whole year of classes, but MIT's...MIT :p
And it'd cost half as much which is a big advantage