This is my code :
using System;
using System.Linq;
using System.IO;
using System.Text;
using System.Collections;
using System.Collections.Generic;
/**
* Auto-generated code below aims at helping you parse
* the standard input according to the problem statement.
**/
class Solution
{
static int L;
static int H;
static List<string> lines = new List<string>();
static void Main(string[] args)
{
L = int.Parse(Console.ReadLine());
H = int.Parse(Console.ReadLine());
string T = Console.ReadLine();
for (int i = 0; i < H; i++)
{
lines.Add(Console.ReadLine());
}
// Write an action using Console.WriteLine()
// To debug: Console.Error.WriteLine("Debug messages...");
T.ToList().ForEach(t => GetASCIILetter(t).ForEach(x => Console.WriteLine(x)));
Console.WriteLine();
Console.ReadKey();
}
static List<string> GetASCIILetter(char letter)
{
List<string> rstr = new List<string>();
lines.ForEach(t => rstr.Add(t.Substring((c`har.ToUpper(letter) - 'A') * (L + 1), L)));
return rstr;
}
}
I tested it before I test it on a letter (because without the letter tested I wouldn’t be sure for a whole word), it worked perfectly for a “Letter” (didn’t optimize it yet to make a word with the ASCII letters given) in Visual Studio but in Codingame an “F” in ASCII art appears. Why ?