
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 26504 Articles for Server Side Programming

125 Views
In this tutorial, we are going to find the zeroes count that need to be flipped to get maximum number of consecutive 1's in the array.We are going to use the sliding window approach to solve the problem. Let's see the steps to solve the problem.Initialize the array and max zeroes to be flipped.Initialize window starting, ending indexes along with the length.Store the max sub array of consecutive 1's length and starting index.Iterate over the array until ending indexes crosses the array length.If the zeroes count is less than the max zeroes count then increment the ending index and zeroes ... Read More

781 Views
In this tutorial, we are going to write a program that finds the election winner. We will have an array of votes that each candidate got in the election. Let's see an example.Input {"A", "B", "C", "B", "A", "C", "D", "D", "A", "B", "D", "B", "A", "C", "D"}Output AHere, A and B got the same number of votes. In that case, we have to select the winner based on the alphabetical order of their names.Let's see the steps to solve the problem.Initialize an array of string with dummy data.Initialize a map with string as key and int as value.Iterate over the votes ... Read More

516 Views
In this tutorial, we are going to write a program that find the number of ways a integer can be expressed as sum of given n-th power of unique numbers.We have two integers number and power. And we need to find in how many ways can we represent the given number as sum of n-th power of unique natural numbers. Let's see an example.Input − number = 50, power = 2Output − 3There is only possible way we can write 4 as sum of 2 powers.We will be using recursion to solve the problem. Let's see the steps to solve ... Read More

130 Views
In this tutorial, we are going to learn how to find the unique pairs that are less than the given number n.Let's see the steps to solve the problem.Initialize the number.Iterate from i = 1 to i < n.Iterate from j = i + 1 to j < n.Print the (i, j).ExampleLet's see the code. Live Demo#include using namespace std; void uniquePairs(int n) { for (int i = 1; i < n; ++i) { for (int j = i + 1; j < n; j++) { cout

793 Views
In this tutorial, we are going to learn how to write a program for union and intersection of two unsorted arrays. Let's see an example.Input arr_one = [1, 2, 3, 4, 5] arr_two = [3, 4, 5, 6, 7]Output union: 1 2 3 4 5 6 7 intersection: 3 4 5Let's see the steps to solve the problem.UnionInitialize the two arrays with random values.Create an empty array called union_result.Iterate over the first array and add every element to it.Iterate over the section array and add element if it is not present in union_result array.Print the union_result array.IntersectionInitialize the two arrays with random ... Read More

243 Views
In this tutorial, we are going to write a program to find two numbers where x + y = n and x * y = n. Sometimes it's not possible to find those types of numbers. We'll print None if there are no such numbers. Let's get started.The given numbers are the sum and products of a quadratic equation. So the number doesn't exist if n2 - 4*n

722 Views
In this article, we will write a C++ program to find the total number of distinct years from a string. Here, we have a string that contains the words and the dates. Our task is to find the number of distinct years mentioned. Let's see the following example scenario to understand the problem better: Scenario 1 Input: str = "The Berlin Wall fell on 09/11/1989. The first website was launched on 06/08/1991." Output: Total number of distinct years: 2 Explanation: Two distinct years are referenced: 1989, and 1991 Scenario 2 Input: str = "TutorialsPoint India was founded on ... Read More

143 Views
In this tutorial, we are going to write a program that computes the time taken for a signal to reach all positions in a string. Let me explain it with an example.We will have a string that contains only s and p characters. s is a signal and p is a position in the string. A signal starts at s and travels in both left and right directions. We are assuming it takes one unit of time to travel to the next position in the string. Our task is to compute the time needed to convert all positions into signals.Let's ... Read More

500 Views
In this tutorial, we are going to write a program that is based on the concepts of LCM. As the title says, we have to find three numbers that are less than or equal to the given number whose LCM is maximum.Let's see an example.Before diving into the problem let's see what LCM is and write program for it.LCM is the least common multiple of a number. It is also known as Least common divisor. For two positive number a and b, the LCM is the smallest integer that is evenly divisible by both a and b.If the given integers ... Read More

686 Views
Kivy is an pen source Python library for rapid development of applications that make use of innovative user interfaces, such as multi-touch apps. It is used to develop the Android application, as well as Desktops applications. In this article we will see how to add labels to the windows created through Kivy.Creating LabelIn the below example we create a window and give it a custom label by using Label function available in uix.lable module. Once we run the app with this code we get the new window showing the custom label.Examplefrom kivy.app import App from kivy.uix.label import Label class ... Read More