I am having an issue getting started with the code.

The problem's description reads:

Robot Rendezvous: 
Imagine a room in which there are n designated “locations”, numbered 1 to n. Two robots, R2 and D2, are placed into the room, possibly at different locations. The robots are programmed so that, whenever a gong is sounded, they simultaneously move to a specified “next” location, according to a given “map”. A map indicates, for each location, which location should be visited next. Thus, a map can be viewed as a function f such that, for each integer i satisfying 1 ≤ i ≤ n, if a robot is at location i, then, upon hearing a gong, it will move to location f(i).

Develop a program that, given as input the number of locations in the room, the initial locations of R2 and D2, and the (common) map that they have been programmed to follow, determines whether the two robots will ever meet (i.e., be at the same location at the same time), and, if so, the location and time (i.e., after how many gong soundings) of their first meeting. If the robots will never meet, that fact should be reported by the program.

Hint: Developing a program that simulates the movements of the two robots is a good ap- proach. However, a program that performs such a simulation, stopping only when the robots meet, is not a correct solution, because it gets trapped in an infinite loop in the case that the robots never meet.

Input 
The input is as follows: The first line contains a positive integer n indicating the number of locations in the room. (You may assume that n ≤ 100.) The second line contains two positive integers (in the range 1 to n) that indicate the initial locations of R2 and D2, respectively. The third line contains a sequence of n positive integers, each in the range 1 to n, representing the map. For each i satisfying 1 ≤ i ≤ n, the i-th number in the sequence indicates the location that is to be visited immediately after location i. (Viewing the map as a function f, the i-th number in the sequence gives the value f(i).)

Output 
The output should include a line that says either “Robots never meet” or “Robots meet at location p after t moves”, where p and t are filled in correctly. In particular, p and t should describe the location and time (i.e., number of moves preceding) the robots’ first meeting.

Sample Input: 

10

3 4 

5 6 8 7 8 1 9 5 4 6 

10 

3 2 

5 6 8 7 8 1 9 5 4 6 

10 

3 6 

5 6 8 7 8 1 9 5 4 6 

15 

2 10

2 4 7 5 3 4 5 9 11 13 8 6 3 11 14 

14 

1 12 

2 3 4 5 6 7 8 8 10 11 12 13 2 3

Corresponding output: 

Robots never meet. 

Robots never meet. 

Robots meet at location 5 after 2 moves. 

Robots never meet. 

Robots meet at location 8 after 8 moves

The method I have at the moment is:

```
public static String robotsMeet(int R2, int D2, int mapSize, int[] map){

    for (int i = map[0]; i < map.length; i++){
            R2 *= map[i];
            D2 *= map[i];
            if (R2 == D2){
                return "Robots meet at location " + map[i] + " after "+ i + " moves.";
            }
    }

    return "Robots never meet.";

}

```

It would be of great help if I could be lead in the right direction or anything else.