7 kyu

Maximum Product

1,381 of 19,424MrZizoScream

Description:

Task

Given an array of integers , Find the maximum product obtained from multiplying 2 adjacent numbers in the array. Note that the array size is at least 2 and consists a mixture of positive, negative integers and also zeroes.

Examples

  • [1, 2, 3] returns 6 because the maximum product is obtained from multiplying  23=6\ 2 * 3 = 6
  • [9, 5, 10, 2, 24, -1, -48] returns 50 because the maximum product is obtained from multiplying  510=50\ 5 * 10 = 50
  • [-23, 4, -5, 99, -27, 329, -2, 7, -921] returns -14 because the maximum product is obtained from multiplying  27=14\ -2 * 7 = -14

Playing with Numbers Series

Playing With Lists/Arrays Series

For More Enjoyable Katas

Fundamentals
Arrays

Stats:

CreatedDec 25, 2017
PublishedDec 25, 2017
Warriors Trained28394
Total Skips2478
Total Code Submissions48998
Total Times Completed19424
C++ Completions1381
C Completions655
Python Completions5291
JavaScript Completions6839
Java Completions2279
Ruby Completions386
C# Completions850
Haskell Completions172
PHP Completions545
Julia Completions38
NASM Completions29
Dart Completions821
CoffeeScript Completions15
TypeScript Completions418
Rust Completions363
Clojure Completions76
Prolog Completions34
Crystal Completions7
COBOL Completions9
D Completions7
Total Stars195
% of votes with a positive feedback rating93% of 2229
Total "Very Satisfied" Votes1948
Total "Somewhat Satisfied" Votes255
Total "Not Satisfied" Votes26
Total Rank Assessments14
Average Assessed Rank
7 kyu
Highest Assessed Rank
6 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • MrZizoScream Avatar
  • anter69 Avatar
  • donaldsebleung Avatar
  • imjasonmiller Avatar
  • B1ts Avatar
  • Blind4Basics Avatar
  • AlexPuts Avatar
  • Voile Avatar
  • realfg Avatar
  • rsa Avatar
  • FArekkusu Avatar
  • user9277937 Avatar
  • cliffstamp Avatar
  • stellartux Avatar
  • RobsonMoon Avatar
  • username0 Avatar
  • user8436785 Avatar
  • ejini战神 Avatar
  • akar-0 Avatar
Ad