7 kyu

Find the Middle of the Product

560 of 1,052dsasser

Description:

Given a string of characters, create a function returning the middle number in the product of each digit in the string.

Example: 's7d8jd9' -> 7, 8, 9 -> 7*8*9=504, thus 0 should be returned as an integer.

Not all strings will contain digits and not all inputs will be string. In those cases, return -1.

If the product has an even number of digits, return the middle two digits

Example: 1563 -> 56

NOTE: Remove leading zeros if product is even and the first digit of the two is a zero. Example 2016 -> 1

Fundamentals
Strings

Stats:

CreatedApr 4, 2018
PublishedApr 5, 2018
Warriors Trained2394
Total Skips72
Total Code Submissions16025
Total Times Completed1052
JavaScript Completions437
PHP Completions88
Python Completions560
Total Stars40
% of votes with a positive feedback rating81% of 282
Total "Very Satisfied" Votes204
Total "Somewhat Satisfied" Votes48
Total "Not Satisfied" Votes30
Total Rank Assessments53
Average Assessed Rank
6 kyu
Highest Assessed Rank
1 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • dsasser Avatar
  • Blind4Basics Avatar
  • FArekkusu Avatar
  • opusartificis Avatar
  • hobovsky Avatar
  • saudiGuy Avatar
  • PetitLu117 Avatar
  • AmirTallap Avatar
Ad