給定一個數值不重複的已排序陣列和目標值,題目要求找出該目標值在這個陣列中的索引位置;若找不到則回傳插入數值的正確排序位置。
Given a sorted array 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.
給定一個數值不重複的已排序陣列和目標值,題目要求找出該目標值在這個陣列中的索引位置;若找不到則回傳插入數值的正確排序位置。
Given a sorted array 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.
此題要求將輸入的已排序陣列移除重複的項目,必須在同一陣列下操作,最後回傳陣列之長度。
Given a sorted array nums, remove the duplicates in-place such that each element appear only once and return the new length.
找出陣列裡元素的重複字元,沒有共同重複字元則回傳空字串。
Write a function to find the longest common prefix string amongst an array of strings.
If there is no common prefix, return an empty string ""
.
在一組陣列中找出兩個數,其加總恰等於給定值。 每個數不能被重複使用,且必剛好只有一個解。
Given an array of integers, return indices of the two numbers such that they add up to a specific target.
You may assume that each input would have exactly one solution, and you may not use the same element twice.