6 kyu

A Combinatorial Way to Get Products and Sums of an Array

173 of 194raulbc777
Description
Loading description...
Fundamentals
Mathematics
Data Structures
Algorithms
  • Please sign in or sign up to leave a comment.
  • ahmet_popaj Avatar

    Nice kata.

  • ejini战神 Avatar

    Description should be language-agnostic (It is by now, but translations may be added in future, soo... ~~)

  • ejini战神 Avatar
    • Ruby 3.0 should be enabled

    • Undeclared variables in initial solution should be replaced with 0

  • Voile Avatar

    Initial code uses Larger than as the last return item's key but everywhere else expects Higher than.

    And the format is wrong either: It's not Equals to max_val: , but Equals to max_val.

    • Awesome A.D. Avatar

      Also, if you're going through the trouble of supplying the output for the users, at least make it correct (i.e. "Equals to max_val: should be f"Equals to {max_val}":. Parsing the provided solution code for your errors and/or omissions shouldn't be part of the task.

    • Awesome A.D. Avatar

      Nevermind, I took the liberty to update the kata:

      • Updated description
      • Updated Python's Initial Solution to something sane
      • Updated test structure and output. Please review and approve
    • Madjosz Avatar

      Approved.

      Issue marked resolved by Madjosz 3 years ago
  • Blind4Basics Avatar

    Hi Raul! Me again! ;)

    well, some points (mix of issues and suggestions but merely the second one) about this kata (all in python, ofc):

    • the strings you provide in the solution setup for the returned list are not at all what you actually expect
    • why do you provide them, actually? :o
    • the string in the lower case seems weird to me. Shouldn't that rather be "Lower than max_val"?
    • not sure the hint about python module is needed (not important, that point)
    • the § about the error handling needs to be formatted with bullet points or something (all in one, for now, so quite unreadable)
    • the first code block shouldn't be one (useless backticks in it) => one less indentation should solve this, I guess
    • why a list of dicts!??? one simple dict would be better, imo.
    • needs a fixed test with max_value < 0
    • needs more random tests (especially with wrong inputs)
    • inconsistency between the description and the random tests implementation: 1) - A list or array of integers >>> (zi > 0 and/or zi < 0) <<< ... but I found zeroes in the random tests: [0, -49, -16, 50, 20, 22, -3] (and same with the beginning of the description: (positive and/or negative) exclude 0 values too)

    cheers!

    • raulbc777 Avatar

      This comment has been hidden.

    • cliffstamp Avatar

      This is an interesting problem, I think with some decent beginner code covering a bunch of things (hash, array, a bunch of methods, etc. )

      BfB, I cleaned up a lot of the issues, the only thing remaining as an issue I believe is the random scope of testing. If you still feel that is an issue let me know and I'll refactor that to spam random fails.

      Issue marked resolved by cliffstamp 7 years ago
  • anter69 Avatar
    • highlight a bit the necessary error-checking
    • description needs some clean-up
    • not really demanding, unlike most of your other katas (at least the ruby version)
  • raulbc777 Avatar

    Thanks, I'll see it

  • CrazyMerlyn Avatar

    Ruby translation kumited.