Subset sum problem

Subset sum problem – You are given sum numbers and a total value. You have to tell if some subset of these numbers can sum up to the given total. Another simple variation is partition problem where you have to divide the set of numbers into 2 groups where sum of each group is same

Share

String interleaving problem

String interleaving problem – You are given 3 strings. You have to tell if first and second string can interleave with each other to form 3rd string or not. Input : String s1 = “abc”; String s2 = “xyz”; String s12 = “axbycz”; Output : true

Share

Text justification problem

Given some strings and a width of a screen. How do you align the strings so that they do not exceed the width of the screen. Or in other words where do you put line breaks between strings so that it looks as pretty as possible or text looks as aligned as possible. Input :… Read more

Share

Coin changing problem

Coin changing problem – Given coins of certain denominations with unlimited quantity and a total, how many minimum number of coins would be needed to form that total. Below is my video link for both bottom up and top down approach. Input : Coins : { 2, 3, 5, 6, 7 } Total : 11… Read more

Share