Here's a puzzle game. I call it Reverse the List of Integers
71–80 of 188 posts
Re: Here's a puzzle game. I call it Reverse the List of Integers
#72the best I can find for [7, 5, 3] is: 7 5 3 7 1 4 3 2 5 1 4 3 2 5 1 7 2 6 7 2 1 5 7 3 5 7
7 5 3
7 1 4 3
2 5 1 4 3
2 6 4 3
2 6 7
2 1 5 7
3 5 7
Re: Here's a puzzle game. I call it Reverse the List of Integers
#73A dynamic programming approach would work. Basically, try everything.
Re: Here's a puzzle game. I call it Reverse the List of Integers
#74If 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
#75Earlier 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.
Re: Here's a puzzle game. I call it Reverse the List of Integers
#76I thought the game was cool so I built a little version of it here: https://blaise.gg/number_game/index.html
Re: Here's a puzzle game. I call it Reverse the List of Integers
#77I 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!
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
#78Re: Here's a puzzle game. I call it Reverse the List of Integers
#79I 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)
Re: Here's a puzzle game. I call it Reverse the List of Integers
#80A dynamic programming approach would work. Basically, try everything.
What do you mean by that exactly and why would it be 'dynamic programming' ?
In reality, it is nothing more than memoization of function calls into an array.