How to Generate Random Float numbers in Python using random and uniform() functions?

How to Generate Random Float numbers in Python using random and uniform() functions?

Python comes with a built-in random module to generate random numbers. The random module provides v…

Check if directed graph is connected

Check if directed graph is connected

Problem Given a directed graph, check if it is connected or not. Sample Input Sample O…

Nth root of M

Nth root of M

Problem Given two integers m and n, find the value of n?m. Sample Input 2?9 Sample Ou…

Implement power function without using multiplication and division operators (Iterative Approach)

Implement power function without using multiplication and division operators (Iterative Approach)

Problem Given two positive integers x and y, implement xy without using multiplication or divisi…

Longest Consecutive Sequence in Linear time

Longest Consecutive Sequence in Linear time

Problem Given an array of integers. Find the length of the longest possible sequence from the ar…

Modular Exponentiation in Logarithmic Time

Modular Exponentiation in Logarithmic Time

Problem Given three integers, a, b, and p. Compute the value of (ab)%p. Sample Input a =…

How to shuffle list in Python using random.shuffle() function?

How to shuffle list in Python using random.shuffle() function?

In this Python tutorial, we will discuss the different functions and methods provided by the Python…

Delete Nodes And Return Forest

Delete Nodes And Return Forest

Problem Given a binary tree and a list of nodes. Return the forest after removing the given node…

Longest Substring without repeating characters

Longest Substring without repeating characters

Problem Given a string, find the longest substring with unique characters Sample Input &…

Python Take list as an input from a user

Python Take list as an input from a user

Using the input() function in Python, we can accept the input from the user. The input() the f…

Partition an array into two subarrays with the same sum

Partition an array into two subarrays with the same sum

Problem Given an array of integers greater than zero, find if it is possible to split it into tw…

Print all subarrays of an array having distinct elements

Problem Given an integer array, print all maximum-sized subarrays having all distinct elements i…