- 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
Narendra Kumar has Published 196 Articles
Narendra Kumar
81 Views
Problem statementWe have given a positive number n, and we have to find a 3*3 matrix which can be formed with combination of 0 or n and has maximum determinants.ExampleIf n = 15 then we can create matrix as follows −{{15, 15, 0}{0, 15, 15}{15, 0, 0}}For any 3*3 matrix ... Read More
Narendra Kumar
85 Views
Problem statementGiven a range [L, R], the task is to find a pair (X, Y) such that L ≤ X < Y ≤ R and X & Y is maximum among all the possible pairs then print the bitwise AND of the found pair.ExampleIf L = 1 and R = ... Read More
Narendra Kumar
136 Views
Problem statementGiven an array, we partition a row of numbers A into at most K adjacent (non-empty) groups, then the score is the sum of the average of each group. What is the maximum score that can be scored?ExampleIf input array is {9, 2, 5, 3, 10} then we can ... Read More
Narendra Kumar
176 Views
Problem statementGiven an array arr[] and two integers X and Y. The task is to find a sub-array of size of at least X and at most Y with the maximum averageExampleIf input array is {2, 10, 15, 7, 8, 4} and x = 3 and Y = 3 then ... Read More
Narendra Kumar
103 Views
Problem statementGiven two same sized arrays A[] and B[]. Task is to form a third array of same size. The result array should have maximum n elements from both array. It should have chosen elements of A[] first, then chosen elements of B[] in same order as they appear in ... Read More
Narendra Kumar
244 Views
Problem statementGiven four sides of quadrilateral a, b, c, d, find the maximum area of the quadrilateral possible from the given sides.AlgorithmWe can use below Brahmagupta’s formula to solve this problem −√(s-a)(s-b)(s-c)(s-d)In above formula s is semi-perimeter. It is calculated as follows −S = (a + b + c + ... Read More
Narendra Kumar
515 Views
Problem statementGiven an array of n positive elements. we need to find the maximum bitwise AND value generated by any pair of element from the array.ExampleIf input array is {10, 12, 15, 18} then maximum value of bitwise AND is 12.AlgorithmThe result of bitwise AND operations on single bit is ... Read More
Narendra Kumar
133 Views
Problem statementGiven a square matrix of order n*n, find the maximum and minimum from the matrixExampleIf given matrix is −{{15, 17, 19}, {5, 1, 7}, {14, 5, 16}} then Minimum number is 1 and maximum number is 19AlgorithmSelect two elements from the matrix one from the start of a row ... Read More
Narendra Kumar
731 Views
Problem statementGiven a number n, the task is to find the maximum 0’s between two immediate 1’s in binary representation of given n. Return -1 if binary representation contains less than two 1’sExampleIf input number is 35 then its binary representation is −00100011In above binary representation there are 3 0’s ... Read More
Narendra Kumar
275 Views
Problem statementGiven a minimum heap find maximum element in that.ExampleIf input heap is −Then maximum element is 55AlgorithmIn minimum heap parent node will be lesser than its children. Hence we can conclude that a non-leaf node cannot be the maximum.Search maximum element in the leaf nodesExampleLet us now see an ... Read More