You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import Foundation
import Glibc
// you can write to stdout for debugging purposes, e.g.
// print("this is a debug message")
publicfunc solution(_ A :inout[Int])->Int{varasum=0varbsum=A.reduce(0,+)varminInterval=1000000000000000000foriin0..<A.count -1{
asum +=A[i]
bsum -=A[i]
minInterval =min(abs(asum - bsum), minInterval)}return minInterval
}
๐ฌย ๋ฌธ์
https://app.codility.com/programmers/lessons/3-time_complexity/tape_equilibrium/
๐ฌย Idea
๐ฌย ํ์ด
์์์๊ฐ
: 30๋ถ์๊ฐ ๋ณต์ก๋
: O(N)ํ๊ฐํ
: https://app.codility.com/demo/results/trainingAJFBW3-6KN/The text was updated successfully, but these errors were encountered: