
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

2K+ Views
The req.path property contains the path part of the requested URL. This property is widely used to track the incoming requests and their paths. It is mainly used for logging the requests.Syntaxreq.pathExample 1Create a file with the name "reqPath.js" and copy the following code snippet. After creating the file, use the command "node reqPath.js" to run this code as shown in the example below −// req.path Property Demo Example // Importing the express & cookieParser module var cookieParser = require('cookie-parser'); var express = require('express'); // Initializing the express and port number var app = express(); // Initializing ... Read More

228 Views
The app.enabled() method checks whether a setting name property is enabled or not. It basically checks the value of a setting name and returns True if the property value is also True.Syntaxapp.enabled( name )Example 1Create a file with the name "appEnabled.js" and copy the following code snippet. After creating the file, use the command "node appEnabled.js" to run this code as shown in the example below −// app.enabled() Method Demo Example // Importing the express module const express = require('express'); // Initializing the express and port number var app = express(); // Initializing the router from express ... Read More

206 Views
In this problem, we are given two values lValue and hValue. Our task is to find the largest twins in given range.Two numbers are said to be twin numbers if both of them are prime numbers and the difference between them is 2.Let's take an example to understand the problem, Input : lValue = 65, rValue = 100 Output : 71, 73Solution ApproachA simple solution to the problem is by looping from rValue - 2 to lValue and checking each pair of i and (i+2) for twins and print the first occurred twin.Another Approach is by finding all prime numbers ... Read More

10K+ Views
An array is a group of similar data elements stored at contiguous memory locations. It is one of the fundamental data structures in programming and used to store and manage multiple values of the same type. Here, we are given an array arr[] containing N unsorted elements, and our task is to find the three largest elements from this array. To understand the problem better. let's see the following example scenarios: Scenario 1 Input: arr[] = {7, 3, 9, 12, 1} Output: 12, 9, 7 Scenario 2 Input: arr[] = {15, 22, 6, 3, 11, 8} Output: 22, 15, ... Read More

991 Views
In this problem, we are given an arr[] consisting of N unsorted elements. Our task is to find the largest pair sum in an unsorted array.We will find a pair whose sum is the maximum.Let's take an example to understand the problem, Input : arr[] = {7, 3, 9, 12, 1} Output : 21Explanation −Pair with largest sum, (9, 12). Sum = 21 Solution ApproachA simple solution to the problem is by making a pair of maximum and second maximum elements of the array.For this we will initialise the max and secondMax elements of the array with the first and ... Read More

179 Views
In this problem, we are given two integer values, n and m. Our task is to find the largest number with n set and m unset bits in the binary representation of the number.Let's take an example to understand the problemInput : n = 3, m = 1 Output : 14Explanation −Largest number will have 3 set bits and then 1 unset bit. (1110)2 = 14Solution ApproachA simple solution to the problem is by finding the number consisting of (n+m) set bits. From this number, toggle off the m bits from the end (LSB). To create a number with (n+m) ... Read More

2K+ Views
In this problem, we are given two integer values, N denoting the count of digits of a number and sum denoting the sum of digits of the number. Our task is to find the largest number with given number of digits and sum of digits.Let's take an example to understand the problem, Input : N = 3, sum = 15 Output : 960Solution ApproachA simple approach to solve the problem is by traversing all N digit numbers from the largest to smallest. The find the digit sum numbers, if it's equal to sum return the number.ExampleProgram to illustrate the working ... Read More

344 Views
In this problem, we are given a doubly linked list LL. Our task is to find the largest node in Doubly Linked List.Let's take an example to understand the problem, Input : linked-list = 5 -> 2 -> 9 -> 8 -> 1 -> 3 Output : 9Solution ApproachA simple approach to solve the problem is by traversing the linked-list and if the data value of max is greater than maxVal's data. After traversing the linked-list, we will return the macVal nodes data.ExampleProgram to illustrate the working of our solution#include using namespace std; struct Node{ int data; ... Read More

198 Views
In this problem, we are given an array arr[] of size N consisting of single digits only. Our task is to find the largest multiple of 2, 3 and 5.Let's take an example to understand the problem, Input : arr[] = {1, 0, 5, 2} Output : 510Explanation −The number 510 is divisible by all 2, 3, 5. Solution ApproachA simple solution to the problem is by checking for basic divisibility of the number created.So, if the number needs to be divisible by 2 and 5 i.e. it is divisible by 10. For creating a number divisible by 10, the ... Read More

304 Views
In this problem, we are given a number N. Our task is to find the largest good number in the divisors of given number N.A good number is a number in which every digit is larger than the sum of digits of its right (all less significant bits than it). For example, 732 is a good number, 7> 3+2 and 3>2.Let's take an example to understand the problem, Input : N = 15 Output : 15Explanation −Divisors of 15 : 1, 3, 5, 15. Solution ApproachA simple solution to the problem is by finding all the divisors of N. And ... Read More