Answer #1 by
ProgramFOX[
^] is very good. In addition to it, i'd like to share another solution which uses Linq.
Dictionary<int, int> dict = new Dictionary<int, int>();
dict.Add(1, 3);
dict.Add(2, 5);
dict.Add(3, 4);
dict.Add(4, 3);
dict.Add(5, 10);
dict.Add(6, 3);
dict.Add(7, 5);
dict.Add(8, 9);
dict.Add(9, 3);
dict.Add(10, 3);
List<int> valuesToFind = new List<int>{3, 3, 3};
var respectiveKeys = dict
.Where(kvp=> valuesToFind.Any(y=>y==kvp.Value))
.Select(kvp=> new
{
k = kvp.Key,
});
foreach (var key in respectiveKeys)
{
Console.WriteLine(key);
}