Given dictionary, sort its items using key-value difference. Input : test_dict = {3 : 9, 1 : 4, 9 : 13, 1 : 10, 8 : 9 } Output : {8: 9, Read more →
Algorithms
6 postsGiven an integer N, the task is to check if it is a enneacontagon number or not. enneacontagon number: is class of figurate number. It has 90 – sided polygon called enneacontagon. 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 →
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 →
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 →
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 →