Index 0 out of bounds for length 0 errror

How can I fix the issue with this problem? I think the problem is at first part of the code but I can’t find a way to fix it.
Write a program that takes an integer argument n, and rolls
fair six-sided dice, n times. Use an …