79682001

Date: 2025-06-27 13:15:37
Score: 1.5
Natty:
Report link

Swift code

100% efficient O(nlogn) time complexity

enter image description here

func solution(_ A: [Int]) -> Int {
    let sortedA = A.sorted()
    var min = 1

    for i in sortedA {
        if i == min {
            min += 1
        }
    }

    return min
}
Reasons:
  • Probably link only (1):
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Sujit Nachan