Print String Permutations
How will you print all permutations of characters in a string?
Mathematical problems involving probability, combinatorics, and number theory.
How will you print all permutations of characters in a string?
You need to a number of floors in a building. There are 68 floors (numbered 1 to 64). Conditions: 1.
A man has to buy 7 floors in a building. Numbered floor 1 to 68. Conditions: 1. He cannot buy
The probability of a car passing a certain intersection in a 20 minute windows is 0.9. What is the probability
Write code to generate all possible combinations of ‘r’ elements in a given array of size ‘n’?
Problem: you are given a sequence of numbers from 1 to n-1 with one of the numbers repeating only once.
This is a card trick without the trick. there is no sleight of hand, no tricks up my sleeve, no
Another well known problem in probability is the Monty Hall problem. You are presented with three doors (door 1, door
At 6 a.m. a man starts hiking a path up a mountain. he walks at a variable pace, resting occasionally,
There are three ants on a triangle, one at each corner. at a given moment in time, they all set
This is difficult to describe in words, so read this carefully, lest there be any confusion. You have a normal
There is a pot of N noodles. (so there are 2N ends). A person randomly grabs two ends and merges
A person dies, and arrives at the gate to heaven. there are three doors. one of them leads to heaven.
Every night, I dump all the change in my pocket into a big bucket. When I buy things, I never
how many trailing zeroes are there in 100! (100 factorial)? Solution One per factor of 10, and one per factor