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
325 Views
We are required to write a JavaScript function that takes in a read only array of n + 1 integers between 1 and n.The function should find one number that repeats in linear time and using at most O(n) space.For example If the input array is −const arr = [3 ... Read More
AmitDiwan
202 Views
Suppose, we have an array that contains some demo credit card numbers like this −const arr = ['4916-2600-1804-0530', '4779-252888-3972', '4252-278893-7978', '4556-4242-9283-2260'];We have been tasked with creating a function that takes in this array. The function must return the credit card number with the greatest sum of digits.If two credit card ... Read More
AmitDiwan
1K+ Views
Suppose, we have the following array of objects −const arr = [ {"2015":11259750.05}, {"2016":14129456.9} ];We are required to write a JavaScript function that takes in one such array. The function should prepare an array of arrays based on the input array.Therefore, the output for the above array should ... Read More
AmitDiwan
641 Views
We are required to write a JavaScript program that provides users an input to fill in a number.And upon filling when the user clicks the button, we should display the sum of all the digits of the number.ExampleThe code for this will be −JavaScript Code −function myFunc() { var ... Read More
AmitDiwan
413 Views
We have a mixed array that we need to sort by alphabet and then by digit −const arr = ['Ab-1', 'Ab-11', 'Ab-12', 'ab-10', 'ab-100', 'ab-101', 'ab2', 'ab-3', 'ab-105'];ExampleThe code for this will be −const arr = ['Ab-1', 'Ab-11', 'Ab-12', 'ab-10', 'ab-100', 'ab-101', 'ab2', 'ab-3', 'ab-105']; const alphaNumericSort = (arr = ... Read More
AmitDiwan
240 Views
Suppose, we have a 2-D array like this −const arr = [ [3, 1], [2, 12], [3, 3] ];We are required to write a JavaScript function that takes in one such array.The function should then create a new 2-D array that contains all elements initialized to undefined ... Read More
AmitDiwan
3K+ Views
Suppose we have the following array of objects −const arr = [ { 'name' : 'd', 'index' : 3 }, { 'name' : 'c', 'index' : 2 }, { 'name' ... Read More
AmitDiwan
2K+ Views
Suppose we have an array of objects that contains data about some houses and price like this −const arr = [ { "h_id": "3", "city": "Dallas", "state": "TX", "zip": "75201", "price": "162500" }, ... Read More
AmitDiwan
290 Views
We are required to write a JavaScript function that takes in an array of Numbers. Our function should iterate through the array and pick the greatest (largest) element from the array and return that element.ExampleThe code for this will be −const arr = [5, 3, 20, 15, 7]; const findGreatest ... Read More
AmitDiwan
526 Views
Suppose, we have a nested array of arrays like this −const arr = [ ["LEFT", "RIGHT", "RIGHT", "BOTTOM", "TOP"], ["RIGHT", "LEFT", "TOP"], ["TOP", "LEFT"] ];We are required to write a JavaScript function that takes in one such array. The function then should pick the smallest subarray (smallest ... Read More