We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
All that the problem seeks is the number of ways of partitioning a given number. e.g. 3 can be partitioned as (1, 2) or (0, 3) taking each of them, multiply each tuple with the given differences i.e. if a=1 and b=2, for the tuple (1, 2), we get the possible numbers for the last stone.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Manasa and Stones
You are viewing a single comment's thread. Return to all comments →
All that the problem seeks is the number of ways of partitioning a given number. e.g. 3 can be partitioned as (1, 2) or (0, 3) taking each of them, multiply each tuple with the given differences i.e. if a=1 and b=2, for the tuple (1, 2), we get the possible numbers for the last stone.