The sum of the largest and the smallest#928

The sum of the largest and the smallest (Discussion)

  1. Huseyn012Jan 3, 2025, 2:45 PM

    it gives 32% for me

    1. MStrechenJan 3, 2025, 6:08 PM

      Huseyn012 I see you were able to fix the problem and get 100% 🔥

  2. user171027Nov 21, 2024, 11:48 AM

    why it gives 74%??

    1. skolodyazhnyyNov 21, 2024, 12:00 PM

      user171027 It looks like the solution you submitted is almost there, but there's a subtle issue in how you're determining the maximum value in the array.

      You're initializing m to 0, and then comparing it to each element in the array to find the maximum value. However, what happens if all the numbers in the array are negative? Since m starts at 0, any negative number will never be considered the maximum.