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 10740 Articles
AmitDiwan
151 Views
By starting from the number 1 and repeatedly either adding 5 or multiplying by 3, an infinite amount of new numbers can be produced. We are required to write a function that, given a number, tries to find a sequence of such additions and multiplications that produce that number. And ... Read More
AmitDiwan
799 Views
We are required to write a function chunk() that takes in an array arr of string / number literals as the first argument and a number n as second argument.We are required to return an array of n subarrays, each of which contains at most arr.length / n elements. And ... Read More
AmitDiwan
672 Views
Suppose, we have an array of Number literals that contains some consecutive redundant entries like this −const testArr = [1, 1, 2, 2, 3, 3, 1, 1, 1];We are supposed to write a function compress that takes in this array and removes all redundant consecutive entries in place. So that ... Read More
AmitDiwan
416 Views
We have an array of numbers that have got some redundant entries, our job is to write a function that takes in the array and groups all the identical entries into one subarray and returns the new array thus formed.For example −//If the input array is: const arr = [1, ... Read More
AmitDiwan
346 Views
We are required to write a JavaScript array function that takes in a nested array and returns an array with all the elements present in the array without any nesting.For example −//if the input is: const arr = [[1, 2, 3], [4, 5], [6]]; //then the output should be: const ... Read More
AmitDiwan
288 Views
We have to write a function that takes in n Number literals as argument, where n is any whole number and returns the smallest number of those numbers without using any library function.We will solve this problem via a while loop and the code for this will be −Exampleconst numbers ... Read More
AmitDiwan
1K+ Views
We have a nested array of strings and we have to write a function that accepts the array and a search string and returns the count of the number of times that string appears in the nested array.Therefore, let’s write the code for this, we will use recursion here to ... Read More
AmitDiwan
504 Views
We have an array of Number literals, and we are required to write a function, say splitDigit() that takes in this array and returns an array of Numbers where the numbers greater than 10 are splitted into single digits.For example −//if the input is: const arr = [ 94, 95, ... Read More
AmitDiwan
691 Views
We have two arrays of Numbers, and we are required to write a function, say 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 − ... Read More
AmitDiwan
595 Views
We have to write a function, say threeSum() that takes in an array of Numbers and a target sum. It checks whether there exist any three numbers in the array that add up to the target sum, if there exist such three numbers in the array, then it should return ... Read More