C# Code runs in visual studio but not in given IDE

C# - There are no error in below code however your IDE is not able to compile this code.

public class Pair{
public TreeNode node {get;set;}
public int dd{get;set;}
}
public List solve(TreeNode A) {
if(A == null){
return null;
}
List result = new List();
Dictionary<int, List> map = new Dictionary<int,List>();
Queue q = new Queue();
q.Enqueue(new Pair(){node = A, dd = 0});
int max_dd =0;
while(q.Count != 0){
var dq = q.Peek();
TreeNode current = dq.node;
int dd = dq.dd;
q.Dequeue();
max_dd = max(max_dd,dd);
if(map.ContainsKey(dd)){
List keys = map.GetValueOrDefault(dd);
var oldVal = current.val;
keys.Add(oldVal);
map[dd] = keys;
}else{
map.Add(dd,new List(){current.val});
}
if(current.left != null){
q.Enqueue(new Pair(){node = current.left,dd = dd +1});
}
if(current.right != null){
q.Enqueue(new Pair(){node = current.right,dd = dd});
}
}
for(int i=0;i<=max_dd;i++){
foreach(var item in map[i]){
result.Add(item);
}
}
return result;
}
private int max(int a,int b){
return a>b?a:b;
}

Click here to start solving coding interview questions