
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
Sunidhi Bansal has Published 1085 Articles

Sunidhi Bansal
499 Views
Given vertices of a forest ( collection of trees). The goal is to find the number of trees in that forest. We will do this by running a DFS (depth first search) algorithm on the forest.For ExampleInputedges = { { 1, 3 }, {2, 8}, {2, 6}, {3, 5}, {3, ... Read More

Sunidhi Bansal
588 Views
Given an array arr[ ] containing integers only and an odd number sum. The goal is to create a sum array arr_2[ ] such each arr_2[i] is the sum of previous sum/2 elements of arr[] + arr[i] + next sum/2 elements of arr[]. If sum is 1 then arr_2[i]=arr[i]For ExampleInputarr[] ... Read More

Sunidhi Bansal
689 Views
Given an amount in rupees that one has to pay, say pay_rupees and an unlimited amount of banknotes that have value as Rupees_amount_1 and Rupees_amount_2. The goal is to pay pay_rupees using exactly the total number of notes=distribution_total and count the number of type Rupees_amount_1 notes required. If there is ... Read More

Sunidhi Bansal
378 Views
Given three numbers R, G and B and letters ‘R’, ‘G’ and ‘B’ only. The goal is to find the count of possible strings that can be made using at least R Rs, at least G Gs and at least B Bs in it. The numbers R, G and B ... Read More

Sunidhi Bansal
412 Views
Given an array arr[ ] containing positive integers and a value match. The goal is to find the subsets of arr[] that contain elements that have XOR = match.For ExampleInputarr[] = {4, 2, 8, 10} match=12OutputCount of number of subsets having a particular XOR value are: 2ExplanationSubsets of arr with ... Read More

Sunidhi Bansal
386 Views
Given an array arr[] containing positive integers. The goal is to find the number of subarrays of length at least 1 which are non−increasing. If arr[]= {1, 3, 2}, then subarrays will be {1}, {2}, {3}, {3, 2}. Count is 4.For ExampleInputarr[] = {5, 4, 5}OutputCount of number of non-increasing ... Read More

Sunidhi Bansal
525 Views
Given an array of holes[10] containing a number of holes in numbers 0 to 9. The goal is to find the number of holes in an integer number given as input. Given − holes[] = { 2, 1, 1, 0, 0, 1, 1, 1, 0 }For ExampleInputnumber = 239143OutputCount the ... Read More

Sunidhi Bansal
416 Views
Given a 2D array arr[][] containing intervals and a number ‘value’. The goal is to find the number of intervals present in arr between which value lies. For example intervals are [ [1, 5], [3, 7] ] and value=4 then it lies in both these intervals and count would be ... Read More

Sunidhi Bansal
282 Views
Given an integer N as input. The goal is to find the count of integers that are less than N and represented in Binary form. For example if input N is 12 then numbers less than 12 are 1, 10, 11 that are binary and contain 0s and 1s as ... Read More

Sunidhi Bansal
412 Views
Given two integers named ‘one’ and ‘another’. The goal is to find the number of possible arrays such that −The elements in the array are in range between 1 and ‘another’.All elements of array are such that arr[i] divides arr[i+1] or arr[i+1] divides arr[i+2]....and so on.The length of the array ... Read More