結果 : how to solve pattern problems in javascript