find k in sorted array; duplicates allowed