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 →
Latest tutorials
505 postsA 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 →
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 →