Get an overview of four pillars of object-oriented programming (OOP) and see their suitable real life examples. What is OOP? Picture a cluttered garage🛠️. Tools are scattered everywhere, various shelves are overflowing ...read more
You are provided with an array of size 8*N and you are provided a permutation of 8*N consecutive integers comprising of all the elements from ‘a’ to ‘a + 7*N ‘. Your ...read more
Given an array with all distinct elements, you need to find the occurrence of every element among all the possible subarrays of the array. Examples: Input: arr[] = { 2 , 1 ...read more
In dart programming, Lists are used for the collection of data. We declare just variables instead of declaring a separate variable for each value of the collection. Lists are indexable so that ...read more
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