An 18-year-old has pleaded guilty to first-degree murder and other charges for a mass shooting in North Carolina in 2022.