Sherlock and Cost Discussions | Algorithms | HackerRank
  • + 0 comments

    Because the result S is calculated using A (not B).

    For the given B = 100, 2, 100, 2, 100, maximum value occurs for A = 100, 1, 100, 1, 100.