5 kyu

Mean Square Error

6,091 of 22,318kylehill

Description:

Complete the function that

  • accepts two integer arrays of equal length
  • compares the value each member in one array to the corresponding member in the other
  • squares the absolute value difference between those two values
  • and returns the average of those squared absolute value difference between each member pair.

Examples

[1, 2, 3], [4, 5, 6]              -->   9   because (9 + 9 + 9) / 3
[10, 20, 10, 2], [10, 25, 5, -2]  -->  16.5 because (0 + 25 + 25 + 16) / 4
[-1, 0], [0, -1]                  -->   1   because (1 + 1) / 2
Arrays
Mathematics
Algorithms

Stats:

CreatedJul 23, 2013
PublishedJul 23, 2013
Warriors Trained29798
Total Skips2675
Total Code Submissions41109
Total Times Completed22318
JavaScript Completions6091
C# Completions2024
PHP Completions1289
Scala Completions378
Python Completions8735
Ruby Completions594
C Completions1771
CFML Completions24
Prolog Completions17
Java Completions1898
Total Stars223
% of votes with a positive feedback rating86% of 1782
Total "Very Satisfied" Votes1357
Total "Somewhat Satisfied" Votes347
Total "Not Satisfied" Votes78
Ad
Contributors
  • kylehill Avatar
  • anter69 Avatar
  • coldshower Avatar
  • donaldsebleung Avatar
  • aweleshetu Avatar
  • kazk Avatar
  • B1ts Avatar
  • the_Hamster Avatar
  • Souzooka Avatar
  • rowcased Avatar
  • FArekkusu Avatar
  • bdw429s Avatar
  • fredc Avatar
  • hobovsky Avatar
  • Glyxerine Avatar
  • induhiu Avatar
  • ZZA123 Avatar
  • Just4FunCoder Avatar
  • KayleighWasTaken Avatar
  • saudiGuy Avatar
  • PetitLu117 Avatar
Ad