标签:list files file return derby leetcode indexof array tco
public class Solution { public string[] ReorderLogFiles(string[] logs) { var list1 = new List<string>(); var list2 = new List<string>(); foreach (var log in logs) { var spacePosition = log.IndexOf(‘ ‘); var c = log[spacePosition + 1]; if (c >= 48 && c <= 57) { list2.Add(log); } else { list1.Add(log); } } var list = list1.OrderBy(x => x.Substring(x.IndexOf(‘ ‘) + 1)).ToList(); list.AddRange(list2); return list.ToArray(); } }
标签:list files file return derby leetcode indexof array tco
原文地址:https://www.cnblogs.com/asenyang/p/9946817.html