我是否有可能以一种允许我确定"9"是排序列表中第一个缺失值而不使用for循环并将每个值与其相邻的值进行比较的方式使用LINQ?
var listStringVals = new [] { "7", "13", "8", "12", "10", "11", "14" };
// sort list to "7","8","10","11","12","13","14"
var sortedList = listStringVals.OrderBy(c => int.Parse(c)).ToList();
// need some magic here to get the first gap in the sorted list
Run Code Online (Sandbox Code Playgroud)