min_stack by c# code