Update 009.cs

use better data structure