Algorithm Stable Matching Problem