You are given four points and in a 3-dimensional Cartesian coordinate system. You are required to print the angle between the plane made by the points and in degrees(not radians). Let the angle be . where x and x…
For this challenge, you are given two complex numbers, and you have to print the result of their addition, subtraction, multiplication, division and modulus operations. The real and imaginary precision part should be…
Calendar Module The calendar module allows you to output calendars and provides additional useful functions for them. class calendar.TextCalendar([firstweekday]) This class can be used to generate plain text calendars…
Polar coordinates are an alternative way of representing Cartesian coordinates or Complex Numbers. A complex number is completely determined by its real part and imaginary part . Here, is the imaginary unit. A polar…
Let's dive into decorators! You are given mobile numbers. Sort them in ascending order then print them in the standard format shown below: The given mobile numbers may have , or written before the actual digit number…
You are given an array of integers, , and a positive integer, . Find and print the number of pairs where and + is divisible by . For example, and . Our three pairs meeting the criteria are and . Function Description…
A string is said to be a special string if either of two conditions is met: All of the characters are the same, e.g. aaa. All characters except the middle one are the same, e.g. aadaa. A special substring is any…
Exceptions Errors detected during execution are called exceptions. Examples: ZeroDivisionError This error is raised when the second argument of a division or modulo operation is zero.>>> a = '1'>>> b = '0'>>> print…
It's New Year's Day and everyone's in line for the Wonderland rollercoaster ride! There are a number of people queued up, and each person wears a sticker indicating their initial position in the queue. Initial positions…
Consider the following version of Bubble Sort: Given an array of integers, sort the array in ascending order using the Bubble Sort algorithm above. Once sorted, print the following three lines: Array is sorted in…
HackerLand National Bank has a simple policy for warning clients about possible fraudulent account activity. If the amount spent by a client on a particular day is greater than or equal to the client's median spending…
You have reached the final level of Hunger Games and as usual a tough task awaits you. You have a circular dining table and N hungery animals.You need to place them on the table.Each animal has a hunger value. You can…
Given A Series Of N Positive Integers a1,a2,a3........an. , Find The Minimum And Maximum Values That Can Be Calculated By Summing Exactly N-1 Of The N Integers. Then Print The Respective Minimum And Maximum Values As A…
Quibdó in Colombia is one among the cities that receive maximum rainfall in the world. All year round, the city is covered in clouds. The city has many towns, located on a one-dimensional line. The positions and…
Starting with a 1-indexed array of zeros and a list of operations, for each operation add a value to each of the array element between two given indices, inclusive. Once all operations have been performed, return the…
Christy is interning at HackerRank. One day she has to distribute some chocolates to her colleagues. She is biased towards her friends and plans to give them more than the others. One of the program managers hears of…
You are working at the cash counter at a fun-fair, and you have different types of coins available to you in infinite quantities. The value of each coin is already given. Can you determine the number of ways of making…
Alice is a kindergarten teacher. She wants to give some candies to the children in her class. All the children sit in a line and each of them has a rating score according to his or her performance in the class. Alice…
You are given an unordered array of unique integers incrementing from . You can swap any two elements a limited number of times. Determine the largest lexicographical value array that can be created by executing no more…
We define a modified Fibonacci sequence using the following definition: Given terms and where , term is computed using the following relation: For example, if and , , , , and so on. Given three integers, , , and…