Solutions for basic array problems.