Arnab Chakraborty has Published 4293 Articles

Big Numbers in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 02-Sep-2020 13:09:40

402 Views

Suppose we have a matrix, we have to find the total number of integers whose value is the largest in its row and column.So, if the input is like132465157then the output will be 2 as 6 and 7 are valid.To solve this, we will follow these steps −mat := matrixr_maxes ... Read More

Base 3 to integer in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 02-Sep-2020 13:06:55

1K+ Views

Suppose we have a string s that is representing a number in base 3 (valid numbers 0, 1, or 2), we have to find its equivalent decimal integer.So, if the input is like "10122", then the output will be 98.To solve this, we will follow these steps −ans := 0for ... Read More

Austin Powers in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 02-Sep-2020 13:05:18

114 Views

Suppose we have a number greater than 0, we have to check whether the number is power of two or not.So, if the input is like 1024, then the output will be True.To solve this, we will follow these steps −while n > 1, don := n / 2return true ... Read More

A unique string in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 02-Sep-2020 13:02:51

965 Views

Suppose we have a string s, we have to check whether it has all unique characters or not.So, if the input is like "world", then the output will be TrueTo solve this, we will follow these steps −set_var := a new set from all characters of sreturn true when size ... Read More

Atbash cipher in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 02-Sep-2020 13:00:21

2K+ Views

Suppose we have a lowercase alphabet string called text. We have to find a new string where every character in text is mapped to its reverse in the alphabet. As an example, a becomes z, b becomes y and so on.So, if the input is like "abcdefg", then the output ... Read More

A strictly increasing linked list in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 02-Sep-2020 12:58:56

277 Views

Suppose we have head of a singly linked list, we have to check whether the values of the nodes are sorted in a strictly ascending order or not.So, if the input is like [2, 61, 105, 157], then the output will be True.To solve this, we will follow these steps ... Read More

A number and its triple in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 02-Sep-2020 12:56:08

705 Views

Suppose we have a list of numbers called nums, we have to check whether there are two numbers such that one is a triple of another or not.So, if the input is like nums = [2, 3, 10, 7, 9], then the output will be True, as 9 is the ... Read More

Ancient Astronaut Theory in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 02-Sep-2020 12:52:14

204 Views

Suppose er have a string dictionary, the dictionary is representing a partial lexicographic ordering of ancient astronauts' dictionary. So, if we have a string s, we have to check whether it's a lexicographically sorted string according to this ancient astronaut dictionary or not.So, if the input is like dictionary = ... Read More

Adding Time in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 02-Sep-2020 12:45:26

4K+ Views

Suppose we have a string that is representing a 12-hour clock time with suffix am or pm, and an integer n is also given, we will add n minutes to the time and return the new time in the same format.So, if the input is like s = "8:20pm" and ... Read More

Acronym in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 02-Sep-2020 12:42:46

1K+ Views

Suppose we have a string s that is representing a phrase, we have to find its acronym. The acronyms should be capitalized and should not include the word "and".So, if the input is like "Indian Space Research Organisation", then the output will be ISROTo solve this, we will follow these ... Read More

Advertisements