Given a number N, the task is to check if N is a dodecahedral Number – Dodecahedral Number belongs to a figurate number and represents it dodecahedron. The first few dodecahedral numbers Read more →
Programs
1 postGiven an array containing n numbers. The problem is to find the length of the longest zigZag subarray such that every element in the subarray should be in form a < b Read more →
Given a Matrix, get index of rows with K as elements. Input : test_list = [[4, 5, 6], [1, 4, 5], [6, 9, 1], [0, 3 ,1]], K = 6 Output : Read more →
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 →
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 →
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 →
Given an array of integers. The task is to find the Minimum index of repeating element in an array in linear time and in a single traversal of the array. Examples: Input Read more →