aboutsummaryrefslogtreecommitdiff
path: root/challenge-044/duncan-c-white/README
blob: 884fd73e4814506a23cc429fb5b2a25c5321bbc5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Task 1: "Only 100, please.

You are given a string "123456789". Write a script that would insert "+"
or "-" in between digits so that when you evaluate, the result should
be 100."

My notes: hmm.. looks like it might be combinatorial.  Is there a clever way?
It's almost like a version of Countdown's number game (without * and /).

Task #2: "Make it $200

You have only $1 left at the start of the week. You have been given an
opportunity to make it $200. The rule is simple with every move you can
either double what you have or add another $1. Write a script to help
you get $200 with the smallest number of moves.
"

My notes: doubling sounds like the way to go..  exhaustive breadth first
search "try both options at every move" seems obvious but combinatorial growth