
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
AmitDiwan has Published 10744 Articles

AmitDiwan
201 Views
We are required to write a JavaScript function that takes in a number, say n, and returns an array containing all the prime numbers upto n.For example: If the number n is 24.Then the output should be −const output = [2, 3, 5, 7, 11, 13, 17, 19, 23];Therefore, let’s ... Read More

AmitDiwan
137 Views
We have an array of arrays of boolean like this −const arr = [[true, false, false], [false, false, false], [false, false, true]];We are required to write a function that merges this array of arrays into a one-dimensional array by combining the corresponding elements of each subarray using the AND (&&) ... Read More

AmitDiwan
170 Views
We have two arrays of numbers like these −const arr1 = [12, 54, 2, 4, 6, 34, 3]; const arr2 = [54, 2, 5, 12, 4, 1, 3, 34];We are required to write a JavaScript function that takes in two such arrays and returns the element from arrays that are ... Read More

AmitDiwan
116 Views
Consider we have an array of Numbers that looks like this −const array = [54, 54, 65, 73, 43, 78, 54, 54, 76, 3, 23, 78];We are required to write a function that counts how many of the elements are in the array below / above a given number.For example, ... Read More

AmitDiwan
192 Views
We are required to write a JavaScript function that takes in an array of numbers with duplicate entries and sums all the duplicate entries to one index.For example: If the input array is −const input = [1, 3, 1, 3, 5, 7, 5, 4];OutputThen the output should be −const output ... Read More

AmitDiwan
126 Views
We have two arrays of Numbers, and we are required to write a function intersection() that computes their intersection and returns an array that contains the intersecting elements in any order. Each element in the result should appear as many times as it shows in both arrays.For example:If input is ... Read More

AmitDiwan
170 Views
We have an array of numbers like this −const arr = [-1, -2, -1, 0, -1, -2, -1, -2, -1, 0, 1, 0];We are required to write a JavaScript function that counts the consecutive groups of nonnegative (positives and 0) numbers in the array.Like here we have consecutive non negatives ... Read More

AmitDiwan
187 Views
We are required to write a JavaScript function that takes in a string representing a number. The function returns true if the number is pandigital, false otherwise.A pandigital number is a number that contains all digits (0-9) at least once.Therefore, let’s write the code for this function −ExampleThe code for ... Read More

AmitDiwan
149 Views
We are required to write a JavaScript function that takes in two strings; creates and returns a new string with first 2 words of first string, next two words of second string, then first, then second and so on.For example: If the strings are −const str1 = 'Hello world'; const ... Read More

AmitDiwan
283 Views
We are required to write a JavaScript function that takes in a string and returns the character which makes second most appearances in the string.Therefore, let’s write the code for this function −ExampleThe code for this will be −const str = 'Hello world, I have never seen such a beautiful ... Read More