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
Madevala JithenderMadevala Jithender 

Help me out to solve Trailhead challenge

Create an Apex class that returns accounts
Create an Apex class that returns a List of Account objects for a user-specified state.
Create an Apex class that contains a static method:
Name: AccountUtils
Method name: accountsByState
The method must return the ID and name of all Account objects that match the BillingState for the state abbreviation passed to the method
Below is my code
public class AccountUtils {
    public static list<account>  accountsByState(string st){
        List<account> acctlist = [select id,name from account where BillingState =:st];
        return acctlist;

Challenge not yet complete in My Trailhead Playground 1
Executing the 'accountsByState' method on 'AccountUtils' failed. Make sure that you named your method correctly, that it's public and static, and that it accepts a String and returns a List of Account objects.
Sai PraveenSai Praveen (Salesforce Developers) 

Please note that Questions about how to pass Trailhead challenges are not on topic, because these challenges are intended to be independent demonstrations of your abilities.

Trailhead Help (

can provide assistance for situations where Trailhead does not appear to be functioning correctly. You can reach out to them if this is the case.Hope above information helps.

Please mark as Best Answer so that it can help others in future.