Skip to content

Instantly share code, notes, and snippets.

@dima-hx
Created April 4, 2020 19:38
Show Gist options
  • Save dima-hx/3710c9aca7a4a6ca27cd78e57566d9f1 to your computer and use it in GitHub Desktop.
Save dima-hx/3710c9aca7a4a6ca27cd78e57566d9f1 to your computer and use it in GitHub Desktop.
PM IT PUMP task
using System;
using System.Linq;
using System.Net.Http;
using System.Threading.Tasks;
namespace PMITPUMP
{
class Program
{
private static HttpClient httpClient {get;} = new HttpClient();
private static async Task Main(string[] args)
{
var mess = await httpClient.GetStringAsync("https://gist.githubusercontent.com/skalinets/23691610f9bbf590b6fba51e373375b4/raw/0b9cc1e97650f5204edbd7b1906e03435506eaf7/mess.txt");
var dic = mess.GroupBy(c=> c).ToDictionary(c=> c.Key, c=> c.Count());
var secretWord = new string(mess.Where(c=> dic[c] < 10).ToArray());
Console.WriteLine(secretWord);
Console.ReadKey();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment