cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
How can I remove the repeat solution of
How can I remove the repeat solution of 24 points game?
Aug 4, 2011 at 7:47am UTC
Guan Kangle
(2)
Hi all,
I made a program that can obtain all the solutions of four numbers ranging from 1 to 13, but there are always repeat solutions such as:
(3+(3/7))*7
((3/7)+3)*7
7*(3+(3/7))
7*((3/7)+3)
Is there any good idea to remove the redundant combinations?
Aug 4, 2011 at 8:39am UTC
hamsterman
(4538)
It's not hard to tell (write a function which can tell) that all of those are the same.
Do post your algorithm though. There may be ways better than filtering the results.
Topic archived. No new replies allowed.