Live data from Hacker News

Here's a puzzle game. I call it Reverse the List of Integers

mathstodon.xyz

71–80 of 188 posts

Re: Here's a puzzle game. I call it Reverse the List of Integers

#74
I hate little puzzles like this when presented in isolation, my brain just bounces off them.

If the EXACT same puzzle was presented as part of a real problem with context and reasons, my brain would be all over it and I'd work out a solution.

As another comment says, it will inevitably show up as a coding interview, one that I would likely fail!

Re: Here's a puzzle game. I call it Reverse the List of Integers

#75
post #31
post #29

Earlier quoted context omitted.

However, as a result of #1, you in fact cannot make negative integers. It’s not possible to split a nonnegative integer into two lesser-or-equal integers such that either of them is negative.

> largest integer in the original list So if the original list was [10, 1] and negative numbers were allowed, then [10, 2, -1] would be allowed.

I believe Sharlin is correct here. Rule #1 states `Split an integer into two smaller integers.` 1 -> [2, -1] breaks this rule due to 2 not being smaller than 1.

Re: Here's a puzzle game. I call it Reverse the List of Integers

#77

I hate little puzzles like this when presented in isolation, my brain just bounces off them. If the EXACT same puzzle was presented as part of a real problem with context and reasons, my brain would be all over it and I'd work out a solution. As another comment says, it will inevitably show up as a coding interview, one that I would likely fail!

Yeah, I agree

I tried doing leetcode for a while but basically just get bored of it

My brain is wired to solve problems and puzzles, but not in isolation. Removed of context I just can't convince myself there's any value in it and I bounce off just as you describe

Re: Here's a puzzle game. I call it Reverse the List of Integers

#79
post #47

I thought the game was cool so I built a little version of it here: https://blaise.gg/number_game/index.html

Fun implementation! There's currently a bug that allows the same number to appear twice after a combination step (I was able to perform 2,3,7,5->5,7,5)

Ran into this as well: I did [8, 1, 4] -> [5, 3, 1, 4] -> [5, 3, 5].

Re: Here's a puzzle game. I call it Reverse the List of Integers

#80

A dynamic programming approach would work. Basically, try everything.

What do you mean by that exactly and why would it be 'dynamic programming' ?

"Dynamic programming" is jargon from competitive programming. It sounds a lot more sophisticated than it is.

In reality, it is nothing more than memoization of function calls into an array.

Post reply on HN