## Python | Convert a list of characters into a string

Given a list of characters, merge all of them into a string. Examples: Input : [‘g’, ‘e’, ‘e’, ‘k’, ‘s’, ‘f’, ‘o’, ‘r’, ‘g’, ‘e’,… Read More »

## Python map function to find row with maximum number of 1’s

Given a boolean 2D array, where each row is sorted. Find the row with the maximum number of 1s. Examples: Example Input: matrix = [[0,… Read More »

## Python | Numbers in a list within a given range

Given a list, print the number of numbers in the given range. Examples: Input : [10, 20, 30, 40, 50, 40, 40, 60, 70] range:… Read More »

## append() and extend() in Python

Append: Adds its argument as a single element to the end of a list. The length of the list increases by one. syntax: # Adds… Read More »

## Python | Print list after removing element at given index

Given an index, remove the element at that index from the list and print the new list. Examples: Input : list = [10, 20, 30,… Read More »

## Extending a list in Python (5 different ways)

Extending a list in python can be done is following ways: 1. Using append() function: We can append at the end of the list by… Read More »

## Python | Check if all the values in a list that are greater than a given value

Given a list, print all the values in a list that are greater than the given value Examples: Input : list = [10, 20, 30,… Read More »

## Python List Comprehension to find pair with given sum from two arrays

Given two unsorted arrays of distinct elements, the task is to find all pairs from both arrays whose sum is equal to x. Examples: Input… Read More »

## Python | Get unique values from a list

Given a list, print all the unique numbers in any order. Examples: Input : 10 20 10 30 40 40 Output : 10 20 30… Read More »

## Python | Maximum sum of elements of list in a list of lists

Given lists in a list, find the maximum sum of elements of list in a list of lists. Examples: Input : [[1, 2, 3], [4,… Read More »

## Python | Check whether two lists are circularly identical

Given two lists, check if they are circularly identical or not. Examples: Input : list1 = [10, 10, 0, 0, 10] list2 = [10, 10,… Read More »

## Prefix sum array in Python using accumulate function

We are given an array, find prefix sums of given array. Examples: Input : arr = [1, 2, 3] Output : sum = [1, 3,… Read More »

## Intersection of two arrays in Python ( Lambda expression and filter function )

Given two arrays, find their intersection. Examples: Input: arr1[] = [1, 3, 4, 5, 7] arr2[] = [2, 3, 5, 6] Output: Intersection : [3,… Read More »

## Python | Check if two lists have at-least one element common

Given two lists a, b. Check if two lists have at least one element common in them. Examples: Input : a = [1, 2, 3,… Read More »

## Python | Reverse an array upto a given position

Given an array arr[] and a position in array, k. Write a function name reverse (a[], k) such that it reverses subarray arr[0..k-1]. Extra space… Read More »