
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

529 Views
Suppose in a gold mine grid of size m * n, each cell in this mine has an integer representing the amount of gold in that cell, 0 means that is empty. We have to find the maximum amount of gold that you can collect under the conditions −Every time we are pointing a cell we will collect all the gold in that cell.From our position we can walk one step to the left, right, up or down.We cannot visit the same cell more than once.Never visit a cell with 0 gold.So if the input is like [[0, 6, 0], ... Read More

361 Views
Suppose we have two integers low and high, we have to find and show a sorted list of all the Stepping Numbers in the range [low, high] inclusive. A Stepping Number is an integer means all of its adjacent digits have an absolute difference of exactly 1. For example, 321 is a Stepping Number but 421 is not. So if the input is like low := 0 and high := 21, then the result will be [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 21]To solve this, we will follow these steps −create one array tempmake ... Read More

699 Views
Suppose a string s is given, a k duplicate removal consists of choosing k adjacent and equal letters from string s and removing them causing the left and the right side of the deleted substring to concatenate together. We will repeatedly make k duplicate removals on the given string s until we cannot change any remaining. We have to find the final string after all such duplicate removals have been made. So if the input is like s = “deeedbbcccbdaa”, and k = 3, then the output will be “aa”, at first delete the “eee” and “ccc” and we will ... Read More

452 Views
Suppose there are two persons Alice and Bob, they are continuing their games with piles of stones. There are a number of piles placed in a row, and each pile has a positive integer number of stones in an array piles[i]. Our objective of the game is to end with the most stones. Alice and Bob take the turns, with Alice starting first. Initially, M = 1. On each player's turn, that player can take all the stones in the first X remaining piles, here 1

252 Views
Suppose we have hours list, this is a list of the number of hours worked per day for a given employee. Here a day is considered to be a tiring day if and only if the number of hours worked is (strictly) greater than 8. One well-performing interval is an interval of days for which the number of tiring days is strictly larger than the number of non-tiring days. We have to find the length of the longest well-performing interval. So if the input is like [9, 9, 6, 0, 6, 6, 9], so then then the output will be ... Read More

203 Views
Suppose we have n flights, and they are labeled from 1 to n. We have a list of flight bookings. The i-th booking indicates using bookings[i] = [i, j, k] this means that we booked k seats from flights labeled i to j inclusive. Find an array answer of length n, showing the number of seats booked on each flight in order of their label. So if the input is like [[1, 2, 10], [2, 3, 20], [2, 5, 25]] and n = 5, then the output will be [10, 55, 45, 25, 25].To solve this, we will follow these ... Read More

835 Views
Suppose there is a vehicle that has capacity empty seats initially available for passengers. The vehicle only drives east, so we cannot turn around and drive west. We have given a list of trips, trip[i] = [num_passengers, start_location, end_location], that contains information about the ith trip:, so that is the number of passengers that must be picked up, and the locations to pick them up and drop them off. Here the locations are given as the number of kilometers due east from our vehicle's initial location. Our module will return true if and only if it is possible to pick ... Read More

594 Views
Suppose we have a set of tiles, where each tile has one letter tiles[i] printed on it. Find the number of possible non-empty sequences of letters that we can make. So if the input is “AAB”, then the output will be 8. As sequences are “A”, “B”, “AA”, “AB”, “BA”, “AAB”, “ABA”, “BAA”To solve this, we will follow these steps −Define one dfs(), that will take countsum := 0for i in range 1 to 26if count[i] = 0, then go for next iteration, without checking the restdecrease count[i] by 1, and increase sum by 1sum := sum + dfs(count)increase count[i] ... Read More

255 Views
Suppose we have a matrix consisting of 0s and 1s, we can choose any number of columns in the matrix and flip every cell in that column. converting a cell changes the value of that cell from 0 to 1 or from 1 to 0. we have to find the maximum number of rows that have all values equal after some number of flips. So if the matrix is like −000001110The output will be 2. This is because after converting values in the first two columns, the last two rows have equal values.To solve this, we will follow these steps ... Read More