[LintCode] Segment Tree Build