## Count consecutive pairs of same elements

Given an array arr[], the task is to count the number of pairs formed by consecutive elements in which both of the elements in a… Read More »

- How can one become good at Data structures and Algorithms easily?
- Cracking Technical Interviews
- Print the nodes of binary tree as they become the leaf node
- Reach the numbers by making jumps of two given lengths
- Dijkstra's shortest path with minimum edges
- Shannon-Fano Algorithm for Data Compression
- Rearrange Odd and Even values in Alternate Fashion in Ascending Order
- How to write a Pseudo Code?
- Sort the array of strings according to alphabetical order defined by another string
- Longest subsequence such that adjacent elements have at least one common digit
- Code Optimization Technique (logical AND and logical OR)
- Iterative Letter Combinations of a Phone Number
- Check if it is possible to reach a number by making jumps of two given length
- Smallest Pair Sum in an array
- Sum of similarities of string with all of its suffixes
- Dividing a Large file into Separate Modules in C/C++, Java and Python
- Merge K sorted arrays | Set 3 ( Using Divide and Conquer Approach )
- Ternary Search
- Find the number in a range having maximum product of the digits
- Count pairs in array whose sum is divisible by K
- Length of the longest alternating subarray
- Smallest power of 2 which is greater than or equal to sum of array elements
- Largest perfect square number in an Array
- Travelling Salesman Problem implementation using BackTracking
- Count common characters in two strings
- Count distinct substrings that contain some characters at most k times
- Number of array elements derivable from D after performing certain operations
- Find alphabet in a Matrix which has maximum number of stars around it
- Array Manipulation and Sum
- Choose atleast two elements from array such that their GCD is 1 and cost is minimum

Given an array arr[], the task is to count the number of pairs formed by consecutive elements in which both of the elements in a… Read More »

Given an array of N integers. The task is to print the elements from the array which are greater than their immediate previous and next… Read More »

Given string str. The task is to check if the string contains consecutive letters and each letter occurs exactly once. Examples: Input: str = “fced”… Read More »

Given two integers x and y and where x is divisible by y. It can be represented in the form of a fraction x/y. The… Read More »

Given a string str and Q queries. Each query consists of an integer K. The task is to find the number of ways of choosing… Read More »

Given an integer N. The task is to find the number of all possible distinct binary strings of length N which have at least 3… Read More »

Given a person who is at position current_pos and a binary string path which is the moves the person took, if path[i] = ‘0’ then… Read More »

Given a string str, the task is to find the count of all the sub-strings of length four whose characters can be rearranged to form… Read More »

Given an integer N, the task is to generate all possible binary strings of length N which contain “01” as the sub-string exactly twice. Examples:… Read More »

Given an array arr[] of integer elements, the task is to arrange them in such a way that these numbers form the smallest possible number.… Read More »

Two players A and B are playing NIM Game with each other. Both are playing optimally. Player A starts the game. The task is to… Read More »

Given that a certain amount of money becomes T1 times itself in N1 years. The task is to find the number of years i.e. N2… Read More »

Given here is a rectangle of length l & breadth b, the task is to find the area of the biggest ellipse that can be… Read More »

Given an integer K, the task is to find the length of the smallest no. N which is divisible by K and formed by using… Read More »

Given an array arr[] of integers of size n. For each element, you have to print the summation of multiplication of every triplet formed using… Read More »