From 099d1cad6b9f081a2150d71514d0b153f105c045 Mon Sep 17 00:00:00 2001 From: Senyo Motey <47481875+senyomotey@users.noreply.github.com> Date: Thu, 25 Aug 2022 16:34:48 +0000 Subject: [PATCH] Update makeArrayConsecutive2.swift fixed the error below: error: cannot use mutating member on immutable value: 'statues' is a 'let' constant var a = statues.sort(); ~~~~~~~ ^ --- Arcade/Intro/makeArrayConsecutive2.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Arcade/Intro/makeArrayConsecutive2.swift b/Arcade/Intro/makeArrayConsecutive2.swift index 4eeaef5..61dd776 100644 --- a/Arcade/Intro/makeArrayConsecutive2.swift +++ b/Arcade/Intro/makeArrayConsecutive2.swift @@ -1,6 +1,6 @@ // https://codefights.com/arcade/intro/level-2/bq2XnSr5kbHqpHGJC func makeArrayConsecutive2(statues: [Int]) -> Int { - var a = statues.sort() + var a = statues.sorted() return a.last! - a.first! + 1 - a.count }