-
Notifications
You must be signed in to change notification settings - Fork 13
/
artificial-emotional-intelligence.cs
26 lines (24 loc) · 1.56 KB
/
artificial-emotional-intelligence.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
using System;
using System.Linq;
class Solution
{
static void Main()
{
var vowels = "aeiouy".ToCharArray();
var consonants = "bcdfghjklmnpqrstvwxz".ToCharArray();
var adjList = new string[] {"adaptable", "adventurous", "affectionate", "courageous", "creative", "dependable", "determined", "diplomatic", "giving", "gregarious", "hardworking", "helpful", "hilarious", "honest", "non-judgmental", "observant", "passionate", "sensible", "sensitive", "sincere"};
var goodList = new string[] {"love", "forgiveness", "friendship", "inspiration", "epic transformations", "wins"};
var badList = new string[] {"crime", "disappointment", "disasters", "illness", "injury", "investment loss"};
var name = Console.ReadLine();
var vInName = name.ToLower().ToCharArray().Where(_ => vowels.Contains(_)).ToArray();
var cInName = name.ToLower().ToCharArray().Where(_ => consonants.Contains(_)).Distinct().ToArray();
if (cInName.Length < 3 || vInName.Length < 2)
Console.WriteLine($"Hello {name}.");
else
{
Console.WriteLine($"It's so nice to meet you, my dear {adjList[Array.IndexOf(consonants, cInName[0])]} {name}.");
Console.WriteLine($"I sense you are both {adjList[Array.IndexOf(consonants, cInName[1])]} and {adjList[Array.IndexOf(consonants, cInName[2])]}.");
Console.WriteLine($"May our future together have much more {goodList[Array.IndexOf(vowels, vInName[0])]} than {badList[Array.IndexOf(vowels, vInName[1])]}.");
}
}
}