Question: I am supposed to solve Problem 25 from Projecteuler. Below is my code, I have no clue, why it is not working.
Can anyone help me? 

```
n <- 0  
a <- 1 
b <- 1 
c <- 0 
while (nchar(a)<1000)  
  n <- n+1  
  c <- b 
  b <- a 
  a <- a + c  

```

Thanks

Answer: 
Generation of non-repeatable numbers is not an easy task compared to a simple shuffling the array or a collection using [`Collections::shuffle`](https://docs.oracle.com/javase/8/docs/api/java/util/Collections.html#shuffle-java.util.List-).

```
final String[] fruitArray = new String[]{"apple", "orange", "pear", "banana",
                                         "cherry", "blueberry", "papaya", "litchi"};

// SHUFFLE
final List<String> fruitList = Arrays.asList(fruitArray);
Collections.shuffle(fruitList);

// TEST IT
fruitList.stream()
         .limit(4)                      // sets the count to 4
         .forEach(System.out::println); // prints qualified random items without repetition

```
You can use Random() object in java.

Below is an example of getting 3 random elements from an ArrayList hope this help you. 

```
 import java.util.ArrayList; 
 import java.util.List; 
 import java.util.Random; 

 public class GFG { 

// Drive Function 
public static void main(String[] args) 
{ 

    // create a list of Integer type 
    List<Integer> list = new ArrayList<>(); 
    // add 5 element in ArrayList 
    list.add(10); 
    list.add(20); 
    list.add(30); 
    list.add(40); 
    list.add(50); 

    GFG obj = new GFG(); 

    // boundIndex for select in sub list 
    int numberOfElements = 3; 

    // take a random element from list and print them 
    System.out.println(obj.getRandomElement(list, 
                                 numberOfElements)); 
} 

// Function select an element base on index and return 
// an element 
public List<Integer> getRandomElement(List<Integer> list, 
                                      int totalItems) 
{ 
    Random rand = new Random(); 

    // create a temporary list for storing 
    // selected element 
    List<Integer> newList = new ArrayList<>(); 
    for (int i = 0; i < totalItems; i++) { 

        // take a raundom index between 0 to size  
        // of given List 
        int randomIndex = rand.nextInt(list.size()); 

        // add element in temporary list 
        newList.add(list.get(randomIndex)); 

        // Remove selected element from orginal list 
        list.remove(randomIndex); 
    } 
    return newList; 
} 
} 

```

Output:

```
  [50, 40, 30]

```