def no_of_misplaced_tiles(state):
    """
    Returns the number of the misplaced tiles in the given state
    
    state: a list representing the state to be checked
    """
    h1 = 0
    goal_state = [[0], [1, 2, 3], [4, 5, 6], [7, 8, 9]]
    for y in range(len(goal_state)):
        for x in range(len(goal_state[y])):
            if state[y][x] != goal_state[y][x]:
                h1 += 1
    return h1