Given a number n (n>=1 && n<=1018), your task is to convert it to 1 in minimum operation and constant space and time complexity. In one operation you can either – Subtract Read more →
Given two numbers n and m, generate all distinct subsequences of length m using numbers from 1 to n. You may repeat a number. INPUT: n=5, groups=3 OUTPUT: 1,1,3 1,2,2 1,3,1 2,1,2 Read more →
A default parameter is a value provided in function declaration that is automatically assigned by the compiler if caller of the function doesn’t provide a value for the parameter with default value. Read more →
In this problem a string is given, our task is to check the string contains even number of 1’s and odd number 0’s or not. Examples: Input : "101010100" Output : Accept Read more →
Considering a clique of n vertices. Determine if it is possible to divide the set of vertices into two equal halves such that there is an edge between any two vertices of Read more →
In Python, dictionary is a collection which is unordered, changeable and indexed. Dictionaries are written with curly brackets, and they have keys and values. It is used to hash a particular key. Read more →
Given a statement(string), the task is to check if that string contains any word which contains ‘a’ in it then print that word otherwise print no any word containing ‘a’ in the Read more →
In this problem a string is given, our task is to check the string is binary string or not. Examples: Input : '01010101010' Output : Accepted Input : 'w3colleges101' Output : Not Read more →
Given a positive integer N, find the N-th triacontakaihenagonal number: the N-th polygonal number of a 31-sided polygon, the triacontakaihenagon. What is a triacontakaihenagonal number? Polygonal numbers count the dots in a Read more →
Given a positive integer N, find out whether N is a tetracontagonal number (also called a tetracontagon number): one of the numbers produced by 40-sided polygons. What is a tetracontagonal number? Polygonal Read more →