python

[Solved]  Shortest and Lexicographically Smallest Beautiful String C++, Java , Python

Lexicographically

You are given a binary string s and a positive integer k. A substring of s is beautiful if the number of 1‘s in it is exactly k. Let len be the length of the shortest beautiful substring. Return the lexicographically smallest beautiful substring of string s with length equal to len. If s doesn’t contain a beautiful substring, return an empty string. A…

[Solved] Maximise Sum C++, Java , Python

Maximise Sum

You are given an array A consisting of N positive integers. You are allowed to do the following operation any number of times: Find the maximum value of ∑i=1N​Ai​ that you can achieve after any (possibly zero) number of operations. Input Format Output Format For each test case,…

[Solved] Construct Product Matrix C++, Java, Python

Product Matrix

Given a 0-indexed 2D integer matrix grid of size n * m, we define a 0-indexed 2D matrix p of size n * m as the product matrix of grid if the following condition is met: Return the product matrix of grid. Example 1:Input: grid = [[1,2],[3,4]] Output: [[24,12],[8,6]] Explanation: p[0][0] = grid[0][1] * grid[1][0] * grid[1][1]…

[Solved] College Details Problem with Python

python

College Details: A technical event was conducted by the Government of India for the various colleges from all over India. On the valedictory function, a momento was given to all the colleges with the college details inscribed on it. The momento’s…

[Solved] Filter Events Problem with Python

python

Filter Events: Write a program to get size of list and its elements and  to find numbers divisible by thirteen from a list using anonymous function (Lambda) and display those numbers. Input Format:The first line of input corresponds to the size of…