There are 7 distinct solutions to the alphametic
YES*NO=MAYBE
Please provide the one maximizing the sum of SOME & MANY
clearvars
lets='yesnomab';
nums='0123456789'
idx=combinator(10,8,'p');
sets=nums(idx);
for i=1:length(sets)
set=sets(i,:);
yes=str2double(set(1:3)); no=str2double(set(4:5));
maybe=str2double(set([6 7 1 8 2]));
if yes*no==maybe
some=str2double(set([3 5 6 2]));
many=str2double(set([6 7 4 1]));
disp([yes no maybe some+many])
end
end
finds
yes no maybe some+many
705 62 43710 9607
706 35 24710 8957
384 27 10368 5741
748 13 9724 9221 (has leading zero)
605 82 49610 10226 <==== highest some+many
705 28 19740 7737
124 58 7192 5553 (has leading zero)
705 38 26790 8457
567 38 21546 9961
|
Posted by Charlie
on 2025-01-22 08:55:05 |