
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 33676 Articles for Programming

427 Views
Any number larger than 1 is said to be prime if it cannot be written as the product of two smaller natural numbers except 1 and the number itself. For instance, 5 is prime since its only product forms, 1 5 and 5 1, both involve 5. Primes play a crucial role in number theory as stated by the prime number theorem, which asserts that any natural number greater than 1 is either a prime itself or can be expressed as a unique product of prime numbers. This theorem highlights the significance of prime numbers in the realm of mathematics. ... Read More

233 Views
The following article discusses an efficient approach to compute the total time taken to type out a word using a single-row keyboard. This is an interesting problem and has been asked previously in technical interviews. Problem Statement Consider a hypothetical scenario wherein all the keys on a keyboard are placed in a single row. The first key is indexed 0 and the last key is indexed 25. For a given string ‘s’ calculate the time taken to type all the characters of ‘s’ on a special keyboard with layout specified as ‘keyboard_layout’. The time taken ... Read More

117 Views
Right rotating an array means shifting its elements to the right by a certain number of positions. In a single right rotation, the last element of the array becomes the first element, and the remaining elements are shifted to the right. Problem Statement The goal is to find the Mth element of an array after performing K right rotations, where K and M are non-negative integers and the array contains N elements. Sample Examples Input arr = [12 34 56 21], K = 2, M = 1 Output 56 Explanation Arr after K right ... Read More

204 Views
In this problem, we will find the sum and product of the K maximum and minimum Fibonacci numbers in the array. The given problem is very basic and aims to focus on improving the problem-solving skills of beginners. The main goal of the problem is to introduce how to filter the Fibonacci numbers from the given array of elements and sum and product minimum and maximum Fibonacci numbers. Problem Statement We have given a nums[] array containing the N integer values. Also, we have given K positive integer. We need to find the sum and product of the K minimum ... Read More

106 Views
In this problem, we will update the level of each child node based on the left and right subtree's weight difference. Here, we will recursively traverse the subtree of each node to get the weight of the left and right subtree. After that, we will again traverse each subtree node to update its level according to the difference in weight of the left and right sub-tree. Problem Statement We have given a complete binary tree containing N levels and 2N -1 nodes. The levels are numbered from 0 to N − 1 in decreasing order (0, -1, -2, -3, etc.). ... Read More

313 Views
In this problem, we will print the Nth Stepping number. The naïve approach for solving the problem is to traverse natural numbers, check whether each number is a Stepping number, and find the Nth Stepping number. Another approach can be using the queue data structure. Problem Statement We have given a positive integer N. We need to print the Nth Stepping number. The number is called a Stepping number if the difference between two adjacent digits of a number is 1. Sample Examples Input N = 15 Output 34 Explanation The Stepping numbers are 1, 2, ... Read More

185 Views
In this problem, we will print all exponential levels of the binary tree. We will use the level order traversal to traverse through each level of the binary tree. After that, we will find minimum P and q values using the first element of the level. In the next step, we can check whether other level values are exponential. Problem Statement We have given a binary tree. We need to print values of all exponential levels of the binary tree. It is given if the values of each node of the level of the binary tree are equal ... Read More

7K+ Views
In the current 21st century, handling data is the most challenging task for organizations with a high volume of data and with the development of data science and machine learning it has become easier to access. The spaces are also known as the whitespaces in between the characters of strings. The space has no data or it is simply empty and it creates a problem for programmers while coding. So, in order to check for spaces in the string involves many methods and some are explained here. Strings are composed of characters and Python Language comes under the OOPS concept ... Read More

280 Views
In this problem, we will find the minimum difference between minimum and maximum array elements after multiplying or dividing any array elements with K. The simple approach to solving the problem is dividing each element of the array with K if divisible, multiplying each element with K, and tracking the array's minimum and maximum elements. Problem Statement We have given array nums[] containing the integer values and positive integer K. We can multiply any number of the nums[] array with K or divide it by K if it is divisible. The given task is to find the minimum difference between ... Read More

172 Views
One of the most important data types is List in the Python language. Various inbuilt methods to be available in python to manipulate the list items like append(), insert(), extend() and so on. Multiple approaches help in finding the alternate front-rear sum of an array. The array is given with n elements and the process involved are first element is added to the last element of the array, second element of an array is added to the second last element value and it continues until all the elements are added together. For example, let’s take the array, [40, 50, ... Read More