You are given a positive integer n, and an array a of positive integers. Find number of such pairs (i,j) such that i<j and ai & aj ≥ ai ^ aj, where Read more →
Programs
1 postA string is called happy if it does not have any of the strings ‘aaa’, ‘bbb’ or ‘ccc’ as a substring. Given three integers a, b and c, return any string s, Read more →
Far away in Lonely lands of Punjab’s village there lived mathematically advanced guy. Let’s call him the lost guy because he remains lost in his Mathematical courses.One of the games he is Read more →
Given an array Arr[N] of integers, where N is the size of the array. Our task is to rearrange the array such that arr[i]%2 = i%2, in other words, the element at Read more →
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 →
Given 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 →
Given a string of length, N finds the minimum number of characters needed to delete to make right and left shift of the remaining string equal. Examples : Input : str: "36363636" Read more →
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 →
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 →