## Length of longest consecutive ones by at most one swap in a Binary String

Given a Binary String of length . It is allowed to do at most one swap between any 0 and 1. The task is to… Read More »

- Must do Math for Competitive Programming
- Which C++ libraries are useful for competitive programming?
- Breadth First Search without using Queue
- 7 Best Coding Challenge Websites in 2020
- Minimize the maximum difference between adjacent elements in an array
- Which Java libraries are useful for competitive programming?
- Speed up Code executions with help of Pragma in C/C++
- Which Python Modules are useful for competitive programming?
- Setting up a C++ Competitive Programming Environment
- Logarithm tricks for Competitive Programming
- Basic Algorithm Techniques Not Taught in Academics
- Writing code faster during Competitive Programming in C++
- Print all possible combinations of the string by replacing '$' with any other digit from the string
- Count of subarrays of an Array having all unique digits
- Check if sum of Fibonacci elements in an Array is a Fibonacci number or not
- Default values in a Map in C++ STL
- Move all zeroes to end of array using Two-Pointers
- Count the number of ways to construct the target string
- How To Approach A Coding Problem ?
- Sum of GCD of all possible sequences
- Minimize the maximum difference of adjacent elements after at most K insertions
- Kth most frequent Character in a given String
- Count of substrings of length K with exactly K distinct characters
- Maximum LCM among all pairs (i, j) from the given Array
- Count of subarrays which start and end with the same element
- Minimum cost of reducing Array by merging any adjacent elements repetitively
- Finding Median of unsorted Array in linear time using C++ STL
- Important functions of STL Components in C++
- Competitive Programming vs Software Development - Where Should I Invest My Time?
- Shortest path in a directed graph by Dijkstra’s algorithm

Given a Binary String of length . It is allowed to do at most one swap between any 0 and 1. The task is to… Read More »

Given an array arr, the task is to print the elements of the array in descending order along with their frequencies. Examples: Input: arr[] =… Read More »

Given an integer N, the task is to find the sum of N and it’s maximum prime factor. Examples: Input: 19 Output: 38 Maximum prime… Read More »

Given an integer N, the task is to find the greatest number less than N such that the sum of its digits is greater than… Read More »

Given two positive integers L and R, the task is to count the elements from the range [L, R] whose prime factors are only 2… Read More »

Flag variable is used as a signal in programming to let the program know that a certain condition has met. It usually acts as a… Read More »

Given a number N, the task is to find the required numbers consist of only 0 and 1 digit whose sum is equal to N.… Read More »

Given an array where elements in small range. The maximum element in the array does not go beyond size of array. Find frequencies of elements.… Read More »

Given an array arr, the task is to find the minimum sum of the elements of the array after applying the following operation: For any… Read More »

Given a 2-D Matrix and an integer ‘K’, the task is to predict the matrix after ‘K’ iterations given as follows: An element 1 in… Read More »

Given a number N(>=3). The task is to find the three integers (<=N) such that LCM of these three integers is maximum. Examples: Input: N… Read More »

Given an integer N, the task is to count the number of triplets (a, b, c) such that a2 + b2 = c2 and 1… Read More »

Given an integer K and an array arr each of whose element x represents a square with two of its vertices as (0, 0) and… Read More »

Given an integer K and a string str of lowercase English characters, the task is to find a string s such that when s is… Read More »

Given a string. The task is to find the maximum occurred substring with a maximum length. These occurrences can overlap. Examples: Input: str = “abab”… Read More »