Re:Making any integer with four 2s (2025)
by genter on Saturday November 07, 2026 @06:59PM
(#50409216)
Are you allowed to brute force it?
Re:Making any integer with four 2s (2025)
by argee on Saturday November 07, 2026 @08:16PM
(#50409649)
That's how you do it right? It's a BFS with 4 being the max depth, and you print whatever numbers in the problem set which you didn't find.
Re:Making any integer with four 2s (2025)
by twoodfin on Sunday November 08, 2026 @08:23AM
(#50413092)
Given the problems ITA solved, thinking about the question that way makes perfect sense.
Re:Making any integer with four 2s (2025)
by dooglius on Saturday November 07, 2026 @11:59PM
(#50410524)
Figuring that out is presumably part of the interview (and would depend on N)
Re:Making any integer with four 2s (2025)
by catlifeonmars on Saturday November 07, 2026 @08:27PM
(#50409706)
[delayed]
to make the problem more interesting, the list of operations can be extended to include exponentiation and concatenation.
for example, using the four basic operations for N=4, and K in [2,9], we get:
7 cannot be computed in 4 2s; 11 cannot be computed in 4 3s; 10 cannot be computed in 4 4s; 8 cannot be computed in 4 5s; 9 cannot be computed in 4 6s; 4 cannot be computed in 4 7s; 5 cannot be computed in 4 8s; 4 cannot be computed in 4 9s;