kth min & corner cases