Partition Array(LintCode 31):

Problem