degree array solution