--- tags: AC LeetCode 刷題讀書會 - 2023 --- # 2023/08/06(日) 每週 LeetCode 刷題 ## 刷題題號 - [35. Search Insert Position](https://leetcode.com/problems/search-insert-position/) ## 解題思路 Given a sorted array of distinct integers and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order. <pre style='background-color:#ggg'> 提供一個由小到大的整數陣列和一個目標值,如果目標值存在陣列中,則回傳位置,反之回傳依排序下應放入之位置。 </pre> ## 回報格式 - 請 Fork 此 Replit 連結(https://replit.com/@AllenLi23/AC-LeetCode-Js-35-Search-Insert-Position)後,進行程式碼解題,並於完成後更新到 Replit 中,再將連結貼至「解題分享區」來與大家交流做法。 解題分享區 --- 讀書會議流程: ex. 21:05開始 #簽到表: https://docs.google.com/spreadsheets/d/1gc16rrF-yZNs845z_nYrdgDIiSECOJok30dNLyQm69A/edit#gid=534323210 1. 題目說明。 2. 題目解析(BigO(n))。 4. 成員分享解題思路。 5. 問題與討論。 <!-- No.0 (請依序排序下去) name: name (回報範例) lighthouse: lighthouse Replit:https://replit.com/@AllenLi23/AC-LeetCode-Js-35-Search-Insert-Position-Allen --> <!-- No.1 name: Peggy lighthouse: peggy8865@gmail.com Replit:https://replit.com/@peggy8865/AC-LeetCode-Js-35-Search-Insert-Position#index.js --> <!-- No.2 name: Bun lighthouse: bun.coding@gmail.com Replit:https://replit.com/@Shu-YinChen/AC-LeetCode-Js-35-Search-Insert-Position#index.js --> <!-- No.3 name: Jack Hung lighthouse: lhhungx@gmail.com Replit:https://replit.com/@LungHsuanHung/AC-LeetCode-Go-35-Search-Insert-Position#solution/solution.go --> <!-- No.4 name: Ben lighthouse: a84012807@gmail.com Replit:https://replit.com/@a84012807/AC-LeetCode-Js-35-Search-Insert-Position#index.js -->