8 kyu

SpeedCode #2 - Array Madness

9,357 of 17,236donaldsebleung

Description:

SpeedCode #2 - Array Madness

Objective

Given two integer arrays a, b, both of length >= 1, create a program that returns true if the sum of the squares of each element in a is strictly greater than the sum of the cubes of each element in b.

E.g.

array_madness(3, {4, 5, 6}, 3, {1, 2, 3}) == true;
// because 4 ** 2 + 5 ** 2 + 6 ** 2 > 1 ** 3 + 2 ** 3 + 3 ** 3
arrayMadness([4, 5, 6], [1, 2, 3]); // returns true since 4 ** 2 + 5 ** 2 + 6 ** 2 > 1 ** 3 + 2 ** 3 + 3 ** 3
Kata.ArrayMadness(new int[] {4, 5, 6}, new int[] {1, 2, 3}) => true // because 4 ** 2 + 5 ** 2 + 6 ** 2 > 1 ** 3 + 2 ** 3 + 3 ** 3
array_madness([4, 5, 6], [1, 2, 3]) => True #because 4 ** 2 + 5 ** 2 + 6 ** 2 > 1 ** 3 + 2 ** 3 + 3 ** 3
{ 4 5 6 } { 1 2 3 } array-madness ! returns t since 4 2 ^ 5 2 ^ + 6 2 ^ + is greater than 1 3 ^ 2 3 ^ + 3 3 ^ +

Get your timer out. Are you ready? Ready, get set, GO!!!

Arrays
Puzzles

Stats:

CreatedApr 2, 2016
PublishedApr 2, 2016
Warriors Trained22196
Total Skips276
Total Code Submissions57903
Total Times Completed17236
JavaScript Completions9357
C# Completions1124
Python Completions6500
Factor Completions17
C Completions555
Total Stars162
% of votes with a positive feedback rating95% of 2677
Total "Very Satisfied" Votes2413
Total "Somewhat Satisfied" Votes242
Total "Not Satisfied" Votes22
Ad
Contributors
  • donaldsebleung Avatar
  • smile67 Avatar
  • Voile Avatar
  • Souzooka Avatar
  • rowcased Avatar
  • isysoi Avatar
  • hobovsky Avatar
  • ejini战神 Avatar
  • user2058606 Avatar
Ad