- 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](https://www.tutorialspoint.com/assets/profiles/124656/profile/60_131452-1581053210.jpg)
Sunidhi Bansal
303 Views
We are given an array of permutation of first N natural numbers. The goal here is to find the index pairs of elements that satisfy the condition mentioned below −If an array is Arr[], then i, j are indexes, count element pairs such that Arr[i]+Arr[j]=max(Arr[x]) such that iRead More
![Sunidhi Bansal](https://www.tutorialspoint.com/assets/profiles/124656/profile/60_131452-1581053210.jpg)
Sunidhi Bansal
1K+ Views
We are given with an array of elements ranging from values 1 to n. Some elements are repeated, and some are missing. The goal is to find the frequencies of all elements in O(n) time and O(1) extra space.InputArr[]= { 1, 2, 2, 3, 4, 4, 4, 5 }Output1→ 1, ... Read More
![Sunidhi Bansal](https://www.tutorialspoint.com/assets/profiles/124656/profile/60_131452-1581053210.jpg)
Sunidhi Bansal
381 Views
We are given several bits n as input for a binary sequence. The goal here is to find the binary sequence of length 2n such that the sum of its first and second half bits is equal. First n bits and next n bits have the same sum.We have a ... Read More
![Sunidhi Bansal](https://www.tutorialspoint.com/assets/profiles/124656/profile/60_131452-1581053210.jpg)
Sunidhi Bansal
429 Views
We are given with an array of integers. The goal is to find the count of elements in the array that satisfy the following condition −For each element the count of numbers greater than or equal to it present in the array should be exactly equal to it. Excluding the ... Read More
![Sunidhi Bansal](https://www.tutorialspoint.com/assets/profiles/124656/profile/60_131452-1581053210.jpg)
Sunidhi Bansal
394 Views
We are given with an array of integers. The array is a sorted rotated array. The goal is to find the number of elements in the array that are equal to or less than the given number K.Approach is to traverse the whole array and count such elements which are ... Read More
![Sunidhi Bansal](https://www.tutorialspoint.com/assets/profiles/124656/profile/60_131452-1581053210.jpg)
Sunidhi Bansal
548 Views
We are given with an array of integers. The goal is to find the maximum number of pairs in the array that when added produce the same sum. We have to find the maximum count of such pairs.InputArr[]= { 1, 2, 3, 4, 2 }OutputMaximum count of pairs with same ... Read More
![Sunidhi Bansal](https://www.tutorialspoint.com/assets/profiles/124656/profile/60_131452-1581053210.jpg)
Sunidhi Bansal
936 Views
We are given with an array of integers. The goal is to find the maximum numbers in array that are equal after performing given operations −Select two elements a[i] and a[j] such that i != j andIncrement a[i] and decrement a[j] ( a[i]++, a[j]-- )We will take the sum of ... Read More
![Sunidhi Bansal](https://www.tutorialspoint.com/assets/profiles/124656/profile/60_131452-1581053210.jpg)
Sunidhi Bansal
2K+ Views
We are given with an array of positive integers. The goal is to find the maximum number of consecutive numbers present in it. First of all we will sort the array and then compare adjacent elements arr[j]==arr[i]+1 (j=i+1), if difference is 1 then increment count and indexes i++, j++ else ... Read More
![Sunidhi Bansal](https://www.tutorialspoint.com/assets/profiles/124656/profile/60_131452-1581053210.jpg)
Sunidhi Bansal
598 Views
We are given with an array of positive and negative integers and a number K. The task is to find the maximum sum of the array after K changes in it’s elements. The single change operation here multiplies the single element by -1.Approach used will be to convert every negative ... Read More
![Sunidhi Bansal](https://www.tutorialspoint.com/assets/profiles/124656/profile/60_131452-1581053210.jpg)
Sunidhi Bansal
243 Views
We are given with two positive numbers num1 and num2. The goal is to find the minimum sum and maximum sum possible of these two after a digit replacement in both of them. We are allowed to replace digits from each of numbers in both of numbers. Suppose num1 is ... Read More