

If a team scores 3 runs off a ball then runs = runs + 3 and balls = balls + 1.If a team scores 2 runs off a ball then runs = runs + 2 and balls = balls + 1.If a team scores 1 run off a ball then runs = runs + 1 and balls = balls + 1.The recurrence will have 6 states, we initially start with runs = 0, balls = 0 and wickets = 0. Recommended: Please try your approach on first, before moving on to the solution.Īpproach: The problem can be solved using Dynamic Programming and Combinatorics. binations() module in Python to print all possible combinations.Write a program to print all permutations of a given string.K’th Smallest/Largest Element using STL.K’th Smallest/Largest Element in Unsorted Array | Set 3 (Worst Case Linear Time).K’th Smallest/Largest Element in Unsorted Array | Set 2 (Expected Linear Time).K’th Smallest/Largest Element in Unsorted Array | Set 1.Reverse an array in groups of given size.Minimum Number of Platforms Required for a Railway/Bus Station.K Centers Problem | Set 1 (Greedy Approximate Algorithm).Greedy Algorithm to find Minimum number of Coins.Find minimum number of coins that make a given value.Bell Numbers (Number of ways to Partition a Set).Count number of ways to reach a given score in a game.Find number of solutions of a linear equation of n variables.Find maximum possible stolen value from houses.Maximum sum such that no two elements are adjacent.Maximum sum such that no two elements are adjacent | Set 2.Number of ways of scoring R runs in B balls with at most W wickets.Perform K of Q queries to maximize the sum of the array elements.Maximum sum after rearranging the array for K queries.ISRO CS Syllabus for Scientist/Engineer Exam.ISRO CS Original Papers and Official Keys.GATE CS Original Papers and Official Keys.
