Tpotify.java
/**
     * Search the position of a genre in the genre list.
     *
     * @param genres The genre list { 'C', 'E', 'H', 'J', 'P' }
     * @param target The genre to search
     * @return index of the target genre in the genres list
     */
Search the position of a genre in the genre list.


Search the position of a genre in the genre list .
public static int indexOf(char[] genres, char target) {
        int i;
        if (genres != null && genres.length > 0)
        for (i = 0; i < genres.length; ++i){
            if (genres[i] == target)
                return i;
        }
        return -1;
    }
public static int indexOf ( char [ ] genres , char target ) { int i ; if ( genres != null && genres . length > 0 ) for ( i = 0 ; i < genres . length ; ++ i ) { if ( genres [ i ] == target ) return i ; } return - 1 ; }
Search the position of a genre in the genre list.
Search the position of a genre in the genre list .