Sherlock and Cost Discussions | Algorithms | HackerRank
  • + 1 comment

    Input and output are independent events. You can follow any order you prefer. Irrespective of when you take inputs, only output matters. Output of the program is compared with the expected output, if it matches, the solution is accepted.