Binomial Coefficient

Problem Statement Find the Binomial Coefficient for a given value of n and k. “In mathematics, the binomial coefficients are the positive integers that occur as coefficients in the binomial theorem. Commonly, a binomial coefficient is indexed by a pair of integers n ≥ k ≥ 0 and is written as ” – quoted from Wikipedia. Example n = 5, k …

Read more

Reverse Integer

Problem Statement “Reverse Integer” problem states that you are given an integer variable n containing the number to be reversed. Write a program to reverse its digits. Reversing an integer is nothing different from reversing a string. We can easily convert an integer into a string. And then use the …

Read more

Seconds to Days

Problem Statement “Seconds To Days” problem states that you are given an integer s referring to the seconds. Print the corresponding number of the days, hours, minutes, and seconds. Example s = 1543765 17dd 20hh 49mm 25ss Explanation: Converting the given input into the required format. We get 17 d, …

Read more

Convert String To Int

Convert string to int, requires us to convert a numeric string given to an integer. Here we are assuming, we are provided with a numeric string without white spaces either in the middle of the characters or at any one of the ends. We are also assuming that the string …

Read more

Translate »