- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Hafeezul Kareem has Published 345 Articles
Hafeezul Kareem
149 Views
In this tutorial, we are going to write a program that finds the number non-negative integral solution of sum equation.The sum equation is x + y + z = n. You are given the number n, you need to find the number of solutions for the equation. Let's see an ... Read More
Hafeezul Kareem
276 Views
Given an n-ary tree and a number, we have to count the number of nodes greater than the given number. Let's see an example.Inputtree = [[4], [1, 2], [3, 5]] n = 2Output3There are 3 nodes with values that are greater than n.AlgorithmInitialise the n-ary tree.Initialise the count to 0.Increment ... Read More
Hafeezul Kareem
139 Views
You are given an array and the index of the target element. We have to count the number of elements greater than the given element to its right. Let's see an example.Inputarr = [2, 3, 5, 1, 4, 2, 6] index = 3Output3The target index element is 1. There are ... Read More
Hafeezul Kareem
109 Views
The stepping number is a number where the difference between the consecutive digits is 1. You are given a number n representing the number of digits. You need to count the total number of stepping numbers with n digits.Let's see an example.Input2Output17The lowest number of 2 digits is 10 and ... Read More
Hafeezul Kareem
85 Views
Given a number N, we need to find the moves required to guess the permutation in the worst-case scenario. The number of moves required to guess the permutation will be n!. Let's take an example.Input5Output129When we have 5 elements, then we have 5 ways to guess, and 4 ways when ... Read More
Hafeezul Kareem
300 Views
In this tutorial, we are going to write a program that finds the number of leaf nodes for every node in the n-ary tree.Given a n-ary tree, we have to find the number of leaf nodes for every subtree. Let's see an example.InputN = 8 tree = [[2, 3], [], ... Read More
Hafeezul Kareem
424 Views
Given a number, we have to find the number of leading zeroes in the binary representation of it. Assuming total bits to be 32. Let's see an example.Input5Output25The binary representation of 5 is 00000...00101. The number of leading zeroes are 29.AlgorithmInitialise the number n.Find the binary representation of n.Subtract the ... Read More
Hafeezul Kareem
105 Views
Given a string, we have to count the number of larger elements on right side of each character. Let's see an example.Inputstring = "abc"Output2 1 0There are 2 larger elements than a on its right side.There is 1 larger element than b on its right side.There are 0 larger elements ... Read More
Hafeezul Kareem
256 Views
The solutions for the equation areThe number of non-negative integral solutions of the equation are $\left(\begin{array}{c}n-k+1\ k\end{array}\right)$The number of positive integral solutions of the equation are $\left(\begin{array}{c}k-1\ n-1\end{array}\right)$Add both to get the required answer. Let's see an example.Inputn = 4 k = 7Output140 AlgorithmInitialise the numbers n and k.Find the ... Read More
Hafeezul Kareem
371 Views
In this tutorial, we are going to write a program the finds the number of integral points between the given two points.The number of points between two given points will be gcd(abs(x2), abs(y1-y2)) - 1.If the line joining is parallel to x-axis, then the number of integral points will be ... Read More