
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
158 Views
We are required to write a function, say sumBetween() that takes in an array [a, b] of two elements and returns the sum of all the elements between a and b including a and b.For example −[4, 7] = 4+5+6+7 = 22 [10, 6] = 10+9+8+7+6 = 40Let’s write the ... Read More

AmitDiwan
447 Views
We are required to write a recursive function, say pushRecursively(), which takes in an array of numbers and returns an object containing odd and even properties where odd is an array of odd numbers from input array and even an array of even numbers from input array. This has to ... Read More

AmitDiwan
677 Views
We have an array of string / number literals that may/may not contain repeating characters. Our job is to write a function that takes in the array and returns the index of the first repeating character. If the array contains no repeating characters, we should return -1.So, let’s write the ... Read More

AmitDiwan
340 Views
We are required to write a function that takes in a ‘HH:MM:SS’ string and returns the number of seconds. For example −countSeconds(‘12:00:00’) //43200 countSeconds(‘00:30:10’) //1810Let’s write the code for this. We will split the string, convert the array of strings into an array of numbers and return the appropriate number ... Read More

AmitDiwan
376 Views
We are given a string that contains some repeating words separated by dash (-) like this −const str = 'monday-sunday-tuesday-tuesday-sunday-sunday-monday-mondaymonday';Now our job is to write a function that returns an array of objects, where each object contains two properties value and count, value is the word in the string (Monday, ... Read More

AmitDiwan
788 Views
We are given a string and an array of strings; our job is to write a function that removes all the substrings that are present in the array from the string.These substrings are complete words so we are also supposed to remove leading or trailing whitespace so that no two ... Read More

AmitDiwan
211 Views
We are required to write a function getAverage() that accepts an array of arrays of numbers and we are required to return a new array of numbers that contains the average of corresponding subarrays.Let’s write the code for this. We will map over the original array, reducing the subarray to ... Read More

AmitDiwan
246 Views
We are required to write a function that takes in an array arr and a number n between 0 and 100 (both inclusive) and returns the n% part of the array. Like if the second argument is 0, we should expect an empty array, complete array if it’s 100, half ... Read More

AmitDiwan
890 Views
We are required to write a function that takes in two strings, we have to return a new string which is just the same as the first of the two arguments but have second argument prepended to its every word.For example −Input → ‘hello stranger, how are you’, ‘@@’ Output ... Read More

AmitDiwan
668 Views
We are required to write a function that removes duplicate objects from an array and returns a new one. Consider one object the duplicate of other if they both have same number of keys, same keys and same value for each key.Let’s write the code for this −We will use ... Read More