Pavitra has Published 145 Articles

Python Program to find the sum of array

Pavitra

Pavitra

Updated on 26-Sep-2019 14:11:29

916 Views

In this article, we will learn about the solution and approach to solve the given problem statement.Problem statementGiven an array as an input, we need to compute the sum of the given array.Here we may follow the brute-force approach i.e. traversing over a list and adding each element to an ... Read More

Python program to find sum of absolute difference between all pairs in a list

Pavitra

Pavitra

Updated on 26-Sep-2019 13:57:48

344 Views

In this article, we will learn about the solution and approach to solve the given problem statement.Problem statementGiven a list input , we need to find the sum of absolute difference between all pairs in a list.Enumerate() method adds a counter to an iterable and returns it in a form ... Read More

Python Program to check whether it is possible to make a divisible by 3 number using all digits in an array

Pavitra

Pavitra

Updated on 26-Sep-2019 12:33:11

276 Views

In this article, we will learn about the solution and approach to solve the given problem statement.Problem statementGiven an array input of integers, we need to find whether it’s possible to make an integer using all the digits available in these numbers such that it would be divisible by 3.Here ... Read More

Python program to check if the given string is pangram

Pavitra

Pavitra

Updated on 26-Sep-2019 12:24:23

9K+ Views

In this article, we will learn about the solution and approach to solve the given problem statement.Problem statementGiven a string input, we need to generate a Python program to check whether that string is Pangram or not.A pangram is a sentence/ series of words which contains every letter in the ... Read More

Python program to check if a given string is number Palindrome

Pavitra

Pavitra

Updated on 26-Sep-2019 12:22:39

7K+ Views

In this article, we will learn about the solution and approach to solve the given problem statement.Problem statementGiven a string input, we need to create a python function to check whether it is a palindrome or not.A string is referred to be palindrome if the reverse of the string is ... Read More

Python Program to check if the given array is Monotonic

Pavitra

Pavitra

Updated on 26-Sep-2019 12:17:17

1K+ Views

In this article, we will learn about the solution and approach to solve the given problem statement.Problem statementGiven an array input Arr containing n integers. We need to check whether the input array is Monotonic in nature or not.An array is said to be monotonic in nature if it is ... Read More

Python program to check if a string contains all unique characters

Pavitra

Pavitra

Updated on 26-Sep-2019 12:14:14

698 Views

In this article, we will learn about the solution and approach to solve the given problem statement.Problem statementGiven a sring input, we need to find whether a string contains all unique characters or not.ApproachWe will create an array of boolean values, where the variable flag at the index i indicates ... Read More

Python Program to Check Armstrong Number

Pavitra

Pavitra

Updated on 26-Sep-2019 12:11:58

2K+ Views

In this article, we will learn about the solution and approach to solve the given problem statement.Problem statementGiven an integer n , we need to check that the given integer is an armstrong number.A positive integer is called an Armstrong number of order n ifabcd... = a^n + b^n + ... Read More

Python Program for Sum of squares of first n natural numbers

Pavitra

Pavitra

Updated on 26-Sep-2019 12:04:49

870 Views

In this article, we will learn about the solution and approach to solve the given problem statement.Problem statementGiven a positive integer N as input . We need to compute the value of 12 + 22 + 32 + ….. + N2.Problem statement:This can be solved by two methodsMultiplication addition arithmeticUsing ... Read More

Python Program for Smallest K digit number divisible by X

Pavitra

Pavitra

Updated on 26-Sep-2019 12:00:10

432 Views

In this article, we will learn about the solution and approach to solve the given problem statement.Problem statementIntegers n and d are given. We need to find the smallest n-digit number divisible by d.Approach1. FirstNow let's we compute MIN : smallest n-digit number (1000...n-times)2. Now, If MIN % X is ... Read More

Previous 1 ... 5 6 7 8 9 ... 15 Next
Advertisements