The problem is to find the number-to-string matching that results in a + b = 3, right?
Test case needs to be changed,thre can be more than 1 solution to the problem.
e.g. in question for example,[afgilstw = 74062195] is also one correct solution.
Suresh, Which test case? Please be more explicit. These were all taken from a list of known problems, so I need more info to understand if one is flawed.
I am saying in general there can be more than one solution e.g. the one in the question, Wait+All = GIFTS , for that[afgilstw = 74062195] is also valid solution. i.e.[ 5769 +722 = 6491]
Note in the instructions: "No left hand zeros"
Difficult to solve in time.
I saw the note regarding "No left hand zeros", but did not put it together until later that it's really a hint regarding the sum; the 'G' in gifts cannot be mapped to a 0. It's clear now, but initially I thought the remark was referring to 'ALL' not having a blank character to the left (e.g. '\ ALL') that would be 0 when mapped to digits (e.g. 0677).
No leading zeros or repeating numbers. Be careful.
% 4956 911 05867
% 9707 766 10473
% wait all gifts
The problem with randomness is that we can't be sure about the time one experiment will take. Sometimes my solution founds the mapping in less than one second, but, in others, it can take 25 seconds: blowing the time limit.
Project Euler: Problem 6, Natural numbers, squares and sums.
Project Euler: Problem 16, Sums of Digits of Powers of Two
Set the array elements whose value is 13 to 0
Find nearest prime number less than input number
Getting the indices from a vector
Project Euler: Problem 8, Find largest product in a large string of numbers
Find best domino orientation
Is this is a Tic Tac Toe X Win?
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office