Skip to content

Instantly share code, notes, and snippets.

Last active April 12, 2020 15:05
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
static void Main(string[] args)
var lines = File.ReadAllLines(@"ナンバープレート一覧.csv", Encoding.UTF8).ToList();
var places = lines.Skip(1).Select(x => x.Split(',')[2]);
var chars = new List<char>();
var charHashSet = new HashSet<char>();
foreach (var name in places)
foreach (var c in name)
if (charHashSet.Contains(c))
File.WriteAllText("chars.txt", string.Join("", charHashSet.ToList().OrderBy(x => x)), Encoding.UTF8);
File.WriteAllText("chars_rank.txt", string.Join("\r\n", chars.GroupBy(x => x).OrderByDescending(y => y.Count()).ThenBy(y => y.Key).Select(y => $"{y.Key}\t{y.Count()}")), Encoding.UTF8);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment