Pergunta de entrevista da empresa Impinj

a lot of technical questions. Example: write code to convert a number to an Excel spreadsheet header.

Resposta da entrevista

Sigiloso

25 de nov. de 2017

public static string IntToExcelHeaderString(int n) { string str = ""; while ((n % 26) >= 0) { str += (char)((n % 26) + 'A'); n = n / 26 - 1; } char[] arr = str.ToCharArray(); Array.Reverse(arr); //Array.Sort(arr); // Reverse() is a Linq function //char[] reversed = str.Reverse().ToArray(); //reversed.ToString(); return new string(arr); }