Posted: Sun Apr 23, 2006 6:24 pm Post subject: (No subject)
yeah that one is pretty easy to understand now when I think about it, thanks to Martin, but I dont get whats going on the if structure in your solution :S
zylum
Posted: Sun Apr 23, 2006 10:28 pm Post subject: (No subject)
thats a nice solution. his arrangement of his for loops is important. it ensures that at each state each number is used at most once. his if statement just checks if the previous state has already been solved.
MysticVegeta
Posted: Mon Apr 24, 2006 5:25 pm Post subject: (No subject)
I see, I used other test case with lower S and arr size and analysed it one-by-one to see what actually is going on. pretty sweet algorithm.