vinaykhatri
Vinay Khatri 24 October, 2021

Reverse every consecutive m-elements of a subarray

Problem Given an array, reverse every sub-array formed by consecutive m elements. Sample Inpu…

vinaykhatri
Vinay Khatri 24 October, 2021

Maximum Product Subset Problem

Problem Given array a, we have to find the maximum product possible with the subset of elements …

vinaykhatri
Vinay Khatri 24 October, 2021

4–Sum Problem | Quadruplets with a given sum

Problem The goal is to count all the quadruplets having a target sum S. Sample Input [2,…

vinaykhatri
Vinay Khatri 24 October, 2021

Print all triplets that form a geometric progression

Problem Given a sorted array of distinct positive integers, print all triplets that form Geometr…

vinaykhatri
Vinay Khatri 24 October, 2021

Python isalpha, insumeric and isalnum(): A complete Guide

The Python isalpha(), isnumeric() and isalnum() are three string methods that return boolean value …

vinaykhatri
Vinay Khatri 24 October, 2021

Count the number of strictly increasing subarrays in an array

Problem Given an array, count the total number of strictly increasing subarrays in it. Sample…

vinaykhatri
Vinay Khatri 24 October, 2021

Shuffle an array according to the given order of elements

Problem Given two integer arrays of the same size, arr[] and index[], reorder elements in arr[] …

vinaykhatri
Vinay Khatri 24 October, 2021

Find duplicates within a range k in an array

Problem You are given an array of integers and a number k. You need to check if duplicates exist…

vinaykhatri
Vinay Khatri 24 October, 2021

Find the longest subsequence formed by consecutive integers

Problem Given an array of integers, find the longest subsequence of consecutive integers. Sam…

vinaykhatri
Vinay Khatri 24 October, 2021

Determine the index of an element that satisfies given constraints in…

Problem Given an array of integers, find an index before which all elements are smallest than it…

vinaykhatri
Vinay Khatri 23 October, 2021

Python SyntaxError: non-default argument follows default argument Sol…

While defining arguments in a function definition, we can set default argument values, making the a…

vinaykhatri
Vinay Khatri 23 October, 2021

Python TypeError: list indices must be integers or slices, not float …

In Python, we use index numbers to access an individual element from a list. The index number of ev…