Yaswanth Varma has Published 377 Articles

Check if array can be sorted with one swap in Python

Yaswanth Varma

Yaswanth Varma

Updated on 08-Aug-2025 17:10:14

322 Views

Sorting is a task used to organize the numbers in increasing order. Usually, we use the sorting algorithms to do this, but in most cases, the array is almost sorted, with two or three numbers in the wrong position. In such scenarios, instead of sorting the entire array, we can ... Read More

Check if any square (with one colored cell) can be divided into two equal parts in Python

Yaswanth Varma

Yaswanth Varma

Updated on 08-Aug-2025 16:17:50

184 Views

Dividing a Square into two Equal Parts In this article, we are given a square of size n*n with exactly one cell coloured. The task is to determine whether this square can be divided into two equal splits by making a single straight cut along the square, ensuring that the coloured ... Read More

Check if any permutation of a number is divisible by 3 and is Palindromic in Python

Yaswanth Varma

Yaswanth Varma

Updated on 07-Aug-2025 18:49:53

193 Views

Divisibility by 3 The given task is to determine whether the permutation of the digits of the given number can form a new number that satisfies two conditions: it must be divisible by 3 and also be a palindromic number. A number is said to be palindromic if the ... Read More

Check if any permutation of a large number is divisible by 8 in Python

Yaswanth Varma

Yaswanth Varma

Updated on 07-Aug-2025 18:38:46

922 Views

Divisibility By 8 According to the divisibility rule of 8, if the last three digits of a number are divisible by 8, then the entire number is divisible by 8. While this is easy to check for small numbers, when it comes to large numbers, generating all the possible permutations ... Read More

Check if any large number is divisible by 19 or not in Python

Yaswanth Varma

Yaswanth Varma

Updated on 07-Aug-2025 13:10:58

408 Views

In mathematics, Divisibility helps us to determine whether a number can be divided by another without leaving a remainder. For example, 6 is divisible by 2 because 6/2 = 3 with no remainder. In this article, we are going to learn how to check if any large number is divisible ... Read More

Check if any interval completely overlaps the other in Python

Yaswanth Varma

Yaswanth Varma

Updated on 07-Aug-2025 12:59:50

2K+ Views

In many programming problems, Intervals are used to represent ranges such as time periods, numeric spans, etc. An interval is typically represented as a pair of numbers (start, end) where start

Check if any anagram of a string is palindrome or not in Python

Yaswanth Varma

Yaswanth Varma

Updated on 30-Jul-2025 18:50:48

479 Views

Check if any Anagram of a String is Palindrome An anagram is a rearrangement of the characters of a word or a phrase to generate a new word, using all the original characters exactly once. For example, thing and night are anagrams of each other. While palindrome is a word ... Read More

Check if an array represents Inorder of Binary Search tree or not in Python

Yaswanth Varma

Yaswanth Varma

Updated on 30-Jul-2025 18:44:15

575 Views

The Binary Search Tree (BST) is a widely used data structure that maintains the elements in a sorted hierarchical order. Each node in the BST follows the specific property: The values in the left subtree are always less than the values of the current node. ... Read More

Check if an array can be divided into pairs whose sum is divisible by k in Python

Yaswanth Varma

Yaswanth Varma

Updated on 30-Jul-2025 18:29:49

247 Views

Check if Array Can Be Divided into Pairs with Sum Divisible by K In this article, we are given an array of integers and a number k. The task is to determine whether it is possible to divide the entire array into pairs such that the sum of every pair ... Read More

Check if all rows of a matrix are circular rotations of each other in Python

Yaswanth Varma

Yaswanth Varma

Updated on 30-Jul-2025 16:38:27

197 Views

Matrices are used to represent and manipulate structured data (such as grids, patterns). While working with matrix manipulation, we may find scenarios where to determine whether all the rows in a given matrix are circular rotations of one another. Circular Rotation in a Matrix A circular rotation of a list ... Read More

Advertisements