I have read the paper explaining the sum of all possible integers is 3 palindromes, but one thing still puzzles me. How do you find the value of D used in the algorithms? I tried some things but since it is only mentioned in one little part it doesn’t make much sense to me. Am I just being stupid...
SSD optimize
Given \$n\$ pages, each page containing \$m\$ sectors, write three functions: (Here x and y are sectors)
insert(x) that stores the input(temporary sector) into a sector,
remove(x) that removes one, and
get(x) that return a sector containing the element.
You can call these functions...
@user I enjoy both. Writing questions because I have a nearly constant stream of ideas, and non-trivial (mathy or whatever complex) answers because it feels so good
though I'm focusing more on questions right now. I'm so busy with whatever things I can't really describe
The challenge is to calculate the digit sum of the factorial of a number.
Example
Input: 10
Output: 27
10! = 10 × 9 × ... × 3 × 2 × 1 = 3628800,
and the sum of the digits in the number 10! is 3 + 6 + 2 + 8 + 8 + 0 + 0 = 27
You can expect the input to be an integer above 0.
Output can be of...
McCarthy's 1959 LISP
In early 1959, John McCarthy wrote a groundbreaking paper defining just nine primitive functions that when put together still form the basis for all LISP-like languages today. The paper is available digitized here:
http://www-formal.stanford.edu/jmc/recursive.pdf
Your job...
You all love cards? They are so fun to play. The challenge today starts with the cards too. So here is the challenge: Make a program that takes no input and print out all the 52 cards name in a full deck in any order(an explaination to the order would be nice. Bonus points for someone who can for...
2D Pathfinding with Momentum
fastest-codecode-challengepath-finding
You are piloting a spaceship, outfitted with an engine that can accelerate you at 1km/s^2 in the direction the ship is facing (you have very good inertial dampers). You also have thrusters which can rotate you 180 degrees in 1s....
m-Distant Primes
Let us call a prime \$p\$ an \$m\$-distant prime \$(m \ge 0, m \in\mathbb{Z})\$ if there exists a power of \$2\$, say \$2^x (x \ge 0, x \in\mathbb{Z})\$, such that \$|2^x-p| = m. \$ For example, \$23\$ is a \$9\$-distant prime as \$|2^5 - 23| = 9\$.
For this challenge, you can ei...
thoughts on changing the title of polyquine, the polyglot-quine challenge, to include "(polyglot quine)" in the title? It's not even on the first page of search results for "polyglot quine"
You're playing rock paper scissors against a computer... except it's really smart and always wins!
Reference implementation in Python:
print("rock paper scissors")
rps=input('type "rock", "paper", or "scissors"')
if rps=="rock":
print("paper, you lose")
if rps=="paper":
print("scissors, you lose
@rak1507 I see the two different approaches to questions like that ("brute-force" vs "somewhat quick") as entirely different competitions within the question. If someone comes up with a 100 byte Jelly answer that takes a fraction of a second to solve all test cases, IMO that's just as impressive (perhaps more, depending on the answer) than a 20 byte version that throws a Memory error for inputs larger than 3
I just prefer going for the shortest answer, and efficiency be dammed :P
I think of my 2 favourite Jelly answers, one is brute-force (this) and one actually is usable (this). I like them both because they were difficult to implement, and the questions have a high score : answers ratio :P
Anyone know a fix for ConnectionAbortedError: [WinError 10053] An established connection was aborted by the software in your host machine (or even the cause of)? OldSandboxPosts crashes every couple of days because of it
@rak1507 If it's just "generate all possible solutions; filter the ones that fit", yeah, that's boring, but some can be clever (sorry, can't think of any examples right now)
For example, given 3 sets of parenthesis, you have:
()()()
((()))
()(())
(())()
(()())
= 5 possible combinations.
Challenge
Program must:
• Take 1 number as an input
• Return one output, the number of possible combinations of parenthesis sets
Shortest number of bytes wins
So, Smokey has a bit of code specifically to send a heartbeat every once in while so that chat.SE doesn't kick it for inactivity, so I'm not sure if it's that or my crappy internet :/
(The bot dies if you kick it, it isn't a fan of abuse)
@RedwolfPrograms I just do del chatbot to delete the chatbot object. SE handles the kicking from inactivating after that (haven't bothered figuring out how to get it to actually log out)