You are viewing a single comment's thread. Return to all comments →
C# Solution :
public static void PrintMinFromHeap(List<string> operations) { var stackList = new List<int>(); foreach (var op in operations) { var splitList = op.Split(" ").Select(x => Convert.ToInt32(x.Trim())).ToList(); var opType = splitList[0]; switch (opType) { case 1: stackList.Add(splitList[1]); break; case 2: stackList.RemoveAll(x => x == splitList[1]); ; break; case 3: Console.WriteLine(stackList.Min());; break; } } }
Seems like cookies are disabled on this browser, please enable them to open this website
QHEAP1
You are viewing a single comment's thread. Return to all comments →
C# Solution :