- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Sunidhi Bansal has Published 1100 Articles
Sunidhi Bansal
170 Views
We are given a string which can contain “ab” and the task is to calculate the count of operations required to remove or delete “ab” from the string. So, our task is to firstly check whether the string contains “ab” or not if yes then we have to make string ... Read More
Sunidhi Bansal
198 Views
We are given an array of integer elements and the task is to calculate the count of sub-arrays that can be formed from the given array such that its elements can form a valid palindrome. Palindromes are the sequences that are arranged similarly from start and the end.Input − int ... Read More
Sunidhi Bansal
272 Views
We are given two strings i.e. str1 and str2 and the task is to calculate the count of strings that can completely be generated from another string, but we can use one character once for forming the string. Like, we will take two strings str1 and str2 and check for ... Read More
Count pairs (p, q) such that p occurs in array at least q times and q occurs at least p times in C++
Sunidhi Bansal
174 Views
We are given an array of positive integers. The goal is to find the count of pairs of elements of arr[] such that pairs have elements ( p, q ) where p occurs in array for at least q times and q occurs in array for at-least p times.Let us ... Read More
Sunidhi Bansal
230 Views
We are given an array of positive integers. The goal is to find the count of pairs of elements of arr[] such that pairs have elements ( A, B ) where frequency of A is B times and frequency of B is A.Let us understand with examples.Input − int arr[] ... Read More
Sunidhi Bansal
422 Views
We are given a string of binary numbers i.e. combination of 0’s and 1’s and an integer value k and the task is to calculate the count of substrings formed with the given binary string having given k 1’s.Input − string str = ‘10000100000’, k = 2Output − Count of ... Read More
Sunidhi Bansal
554 Views
We are given a string str[] and a number n. The goal is to find all substrings of str[] that have length n. If string is “abcde” and n=3 then substrings of length 3 are “abc”, “bcd”, “cde” and count is 3.Let us understand with examples.Input − str[] = “computer” ... Read More
Sunidhi Bansal
195 Views
We are given a string str[] containing ‘a’, ‘b’ and ‘c’ only. The goal is to find the substrings of str[] such that all the three characters are not part of that substring. For any string str, substrings could be “a”, “b”, “c”, “abb”, “bba”, “bc”, “ca”, “ccc” but not ... Read More
Sunidhi Bansal
235 Views
We are given a string str[] and a character X. The goal is to find the substrings of str[] such that all the substrings contain X at least once. For str[]=”abc '' and X=’a’, the substrings containing ‘a’ at-least once are “a”, “ab”, “abc”. The count is 3.Let us understand ... Read More
Sunidhi Bansal
244 Views
We are given an array arr[] containing integer elements and a variable k . The goal is to find the count of subarrays of arr[] that have greatest/maximum element more that k. If the array is [1, 2, 3] and k is 1. Then possible subarrays are [1], [2], [3], ... Read More