undefined says to YSITD
复杂度O(n) 空间O(1)?