function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Ashwini ns 5Ashwini ns 5 

Create an Apex class that returns an array (or list) of strings.(Trailhead)

If the code is correct but not accepting in trail head means its because of the space b/w Test and i .

try this code:

public class StringArrayTest {

    public static List<String> generateStringArray(integer lenght){
        
        List<String> st=new List<String>();
        For(integer i=0;i<lenght;i++)
        {
            st.add('Test'+ ' '+ i);   //check this part you need to provide space.
            system.debug(st[i]);
        }
        return st;
    }
}