看板
[ Soft_Job ]
討論串[討論] 面試遇到的考題
共 27 篇文章
內容預覽:
剛想一下寫的,希望大家幫忙指教一下有沒有邏輯上的瑕疵. function int ArrayMax(int[] arr). {. // 宣告一個最後要回傳的結果. int MaxValue = 0;. // 如果array長度只有1,就自己傳回去. if(arr.length == 1). retu
(還有1832個字)
內容預覽:
define:. N[i] = the input integer sequence with length n.. M[i] = max { N[j] * N[j+1] * ... * N[i-1] * N[i] | where j >= 0 and j <= i }. = max { M[i-1
(還有268個字)
內容預覽:
Haskell 的 一行文. mulMax = maximum . fst . foldl. (\(maxs@(max:_), mins@(min:_)) x ->. ((maximum $ map (*x) [1,min,max]) : maxs,. (minimum $ map (*x) [1,
(還有91個字)
內容預覽:
之前面試也有考這題.... 我是這樣解法 不知道哪邊有問題?. int[] array = new int[] { -2 , 0 , 3 , 5 , -7 };. int max = array[0] * array[1];. for (int i = 0; i < array.length - 1
(還有417個字)