public class Program
{
public static void Main()
{
Solve();
}
public static void Solve()
{
string filepath = "../../../Input.txt";
//Part 1
var Sum1 = File.ReadAllLines(filepath)
.Select(line => line.Chunk(line.Length / 2).ToArray())
.Select(item => item[0].Intersect(item[1]).First())
.Select(letter => Char.IsLower(letter) ? letter - 96 : letter - 38)
.Sum();
Console.WriteLine(Sum1);
//Part 2
var Sum2 = File.ReadAllLines(filepath)
.Chunk(3)
.Select(item => item[0].Intersect(item[1]).Intersect(item[2]).First())
.Select(letter => Char.IsLower(letter) ? letter - 96 : letter - 38)
.Sum();
Console.WriteLine(Sum2);
}
}