using System.Collections.Generic;
public record MyClass(string Z, string T, int Y);
public static string Case4() {
var I = new MyClass("Forever", "foo", 11); int III = 3;
var II = Enumerable.Repeat(I, III)
.Select(i => i with { T = i.T + i.Y })
.ToList().ToDictionary(_ => --III);
var IIII = II.Select(p3 => p3.Value with { Y = p3.Key.ToString().Length });
return IIII.Sum(p5 => p5.T.Length).ToString();
public static string Case3() {
var I = new MyClass("Asd", "foo", 11); int III = 1;
var II = Enumerable.Repeat(I, III)
.Select(i => i with { Y = ++III % 2 })
.ToList().ToDictionary(_ => III++);
var charmander = II.GroupBy(a => a.Value);
charmander.OrderByDescending(c => c.Key);
return charmander.First().ToString();
public static string Case2() {
IEnumerable<(string N, int U)> list =
new List<(string, int)>() {
new("foo", 1), new("bur", 2), new("baz3", 3), new("foo12", 1),
new("ba",2 ), new("fu", 3), new("fubar",4 ), new("bazbur", 5) };
x => x.N.Length == list.Max(l => l.N.Length))
.Where(x => x.ToString().Length < list.Max(l => l.N.Length) - 1);
return test.Last().ToString();
public static string Case1() {
IEnumerable<(string N, string U)> list =
new List<(string, string)>() {
new("foo", "1"), new("bur", "2"), new("baz3pikachu", "3"),
new("foo12", "1"), new("ba", "2"), new("fu", "3"),
new("fubar", "4"), new("bazbur", "5")};
.GroupBy(x => x.N.Length == list.Max(l => l.N.Length) ? "x" : "y")
static void Main(string[] args) {
Console.WriteLine(Case1());
Console.WriteLine(Case2());
Console.WriteLine(Case3());
Console.WriteLine(Case4());