Neumanns Random Generator

Back to Problem Solutions forum

transingularity     2015-08-02 13:46:16

Hi, I'm trying to solve this task, but I got problems and I don't know where is mistake.

Here is my code, it almost works right :D :

import java.util.*;
import java.lang.*;

public class RandomGenerator {
    public static void main (String[] args) {

        // the code was cut to avoid spoiling solution - Admin :)

    }
}

For this input: 1855 3416 6810 3173 9251 2026 4655 1109 3693 6690 6068. I get this answer: 99 106 5 21 2 3 1 1 67 1 4. But the right answer is: 99 110 104 97 110 97 110 100 101 109 107.

Thank you for help.

transingularity     2015-08-02 13:49:39

Well. I did it. I forgot that List didn't clear automatically. Thank you :D

It would be good if Rodion make this post private or delete this post or something, becasue code is working and missing just one method. Thank you.

Rodion (admin)     2015-08-02 17:09:16
User avatar

Hi! I'm glad you was able to find out the problem so fast! :)

I will erase the code from your post for now to avoid spoiling solution, thank you! :)

Please login and solve 5 problems to be able to post at forum