# Write a program to print all subset of a given string recursively

In this article we will learn how to write a program to print all subset of a given string recursively.

More than a Pathshala

In this article, we will understand about sparse matrix and learn how to write a program to check whether given matrix is sparse or not.

This is one of the most important data structure interview question asked by various companies like Google, Microsoft, Amazon

You are given an array of infinite length containing zeros followed by ones. How fast can you locate the first one in the array? This question has been asked in various interviews.

In this article, we will understand how to calculate sum of all nodes of binary search tree. This is one of the most frequently asked data structure interview question related to tree.

In this article, we will understand how to print BST in spiral form. This is one of the most frequently asked interview questions in various interviews.

In this article, we will discuss about problem - A jail has N prisoners, and each prisoner has a unique id number, S, ranging from 1 to N. There are M sweets that must be distributed to the prisoners.
The jailer decides the fairest way to do this is by sitting the prisoners down in a circle (ordered by ascending S), and then, starting with some random S, distribute one candy at a time to each sequentially numbered prisoner until all M candies are distributed. For example, if the jailer picks prisoner S = 2, then his distribution order would be (2, 3, 4, 5,..., n-1, n, 1, 2, 3, 4,...) until all M sweets are distributed.
But wait —there's a catch—the very last sweet is poisoned! Can you find and print the ID number of the last prisoner to receive a sweet so he can be warned?