Generally, we use swapcase() to swap strings in Python. What if we are asked to do swapping without using the method. In this article, I will be sharing python program to swap Read more →
Given a set, test if any element from range exists in set. Input : test_set = {1, 5, 2, 7, 3, 4, 10, 14}, strt, end = 8, 12 Output : True Read more →
Given a tuple list with probability, get a random tuple. Input : test_list = [(4, 5), (7, 6), (1, 0), (3, 4)], prob_list = [0.4, 0.3, 0.1, 0.2] Output : [(7, 6)] Read more →
Given a binary matrix of order m*n, the task is to find the distance of nearest 1 for each 0 in the matrix and print final distance matrix. From any cell (i,j), Read more →
Given a positive integer N, the task is to check whether the given number N is Even or Odd. Examples: Input : N = 10 Output : Even Input : N = Read more →
Given two numbers A and B, the task is to calculate GCD of A and B. Examples: Input : A = 4, B = 6 Output : 2 Input : A = Read more →
Given a number N, the task is to find Nth Fibonacci number. The Fibonacci numbers are the numbers in the following integer series. 0, 1, 1, 2, 3, 5, 8, 13, 21, Read more →
Count the number of even/odd results after performing a series of calculation on a range of numbers. Given that: Each layer of calculation have two numbers (say a and b) associated with Read more →
Write a program in C++ to depict the concept of overriding or Dynamic polymorphism. Overriding is a type of polymorphism. Polymorphism in OOP languages means to take more than one form. Virtual Read more →
For the given hour and minute let say “hh” and “mm” print the next sooner palindromic time. Example: Input: hh = 02 mm = 03 Output: 02:20 Explaination:For the hour 02 and Read more →