Open
Description
Would a pull request be accepted that discusses sub-optimal solutions to the puzzles? For example, the following solution for the Two-Sum Problem is the most concise (and perhaps one of the most obvious) but has O(n^2) complexity:
for x in 0..<array.count {
let currentNumber = array[x]
let numberNeeded = target - currentNumber
if let targetIndex = array.firstIndex(of: numberNeeded) {
return (x, targetIndex)
}
}
Metadata
Metadata
Assignees
Labels
No labels