Sudhir sharma has Published 1206 Articles

Find maximum value of Sum( i*arr[i]) with only rotations on given array allowed in C++

sudhir sharma

sudhir sharma

Updated on 12-Mar-2021 06:32:48

102 Views

In this problem, we are given an array arr[] consisting of n elements. We need to Find maximum value of Sum( i*arr[i]) with only rotations on a given array allowed. For find the maximum sum of (i*arr[i]), we can perform any number of rotations.Let’s take an example to understand the ... Read More

Find Maximum value of abs(i – j) * min(arr[i], arr[j]) in an array arr[] in C++

sudhir sharma

sudhir sharma

Updated on 12-Mar-2021 06:30:15

274 Views

In this problem, we are given an array arr[] insisting of N integer values.Our task is to Find Maximum value of abs(i – j) * min(arr[i], arr[j]) in an array arr[].Problem description − we need to find the maximum product value of the minimum value of two elements and the ... Read More

Find maximum sum taking every Kth element in the array in C++

sudhir sharma

sudhir sharma

Updated on 12-Mar-2021 06:27:09

167 Views

In this problem, we are given an array arr[] and an integer k. Our task is to Find the maximum sum taking every Kth element in the array.Problem description: We need to find the maximum sum of the elements of the array such that they are k indexes apart. i.e. ... Read More

Find maximum sum array of length less than or equal to m in C++

sudhir sharma

sudhir sharma

Updated on 12-Mar-2021 06:23:44

121 Views

In the problem, we are given n arrays of different length. Our task is to Find the maximum sum array of length less than or equal to m.We need to find sub-arrays from the arrays to maximise the sum and make the length of all subarrays combined equal to m.Let’s ... Read More

Find Maximum side length of square in a Matrix in C++

sudhir sharma

sudhir sharma

Updated on 12-Mar-2021 06:00:41

194 Views

In this problem, we are given a 2-D matrix mat[][] of size n, n being an odd number. Our task is to Find Maximum side length of a square in a Matrix.Problem Description − We need to find the length of the square matrix whose perimeter values are the same ... Read More

Find maximum possible stolen value from houses in C++

sudhir sharma

sudhir sharma

Updated on 12-Mar-2021 05:57:40

527 Views

In this problem, we are given n houses with some values in them. Our task is to Find the maximum possible stolen value from houses.Problem Description − We have an array houses[] that consist of the values that are in each house. A thief robs the houses but he cannot ... Read More

Find maximum path length in a binary matrix in Python

sudhir sharma

sudhir sharma

Updated on 12-Mar-2021 05:53:41

205 Views

In this problem, we are given a square matrix mat[][] of size m X n with each element either 0 or 1. If an element has value 1, this means it is connected, if the value is 0, this means it is not-connected. Our task is to find the maximum ... Read More

Find maximum of minimum for every window size in a given array in C++

sudhir sharma

sudhir sharma

Updated on 12-Mar-2021 05:49:21

680 Views

In this problem, we are given an array arr[] of size n. Our task is to Find the maximum of the minimum for every window size in a given array.Problem Description − We need to find the maximum of the minimum of a window size that varies from 1 to ... Read More

Find Maximum number possible by doing at-most K swaps in C++

sudhir sharma

sudhir sharma

Updated on 27-Jan-2021 05:08:36

531 Views

In this problem, we are given two integer values n and k. Our task is to find the Maximum number possible by doing at-most K swaps. Problem description: Here, we need to calculate the number which is maximum and created after swapping at-most k digits of the number.Let’s take an example to ... Read More

Find maximum level sum in Binary Tree in C++

sudhir sharma

sudhir sharma

Updated on 27-Jan-2021 05:08:07

105 Views

In this problem, we are given  a binary Tree with positive and negative values. Our task is to Find maximum level sum in Binary Tree. Problem Description: We have a binary tree, we will find the sum of all levels in the binary tree and then return the maximum of them.Let’s take ... Read More

Advertisements