
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
250 Views
ProblemWe are required to write a JavaScript function that takes in an array of numbers containing numbers from 1 to n.The problem is that one number from the array goes missing and the array is not sorted as well. Our function should find and return that one number missing from ... Read More

AmitDiwan
278 Views
ProblemWe are required to write a JavaScript function that takes in a number n. Our function should find all such number x and y such that −x^2 - 4y^2 = n.And it should return an array of all such pairs.ExampleFollowing is the code − Live Democonst num = 90005; const findSolution ... Read More

AmitDiwan
169 Views
ProblemWe are required to write a JavaScript function that takes in a number n. Our function should find and return that smallest possible number which is divisible by all numbers from 1 to n.ExampleFollowing is the code − Live Democonst num = 11; const smallestDivisible = (num = 1) => { ... Read More

AmitDiwan
3K+ Views
When it is required to create a list of tuple, and have the first element as the number, and the second element as the square of the element, list comprehension can be used.Below is the demonstration of the same −Example Live Demomy_list = [23, 42, 67, 89, 11, 32] print(“The list ... Read More

AmitDiwan
930 Views
When it is required to find the second largest number in a list using bubble sort, a method named ‘bubble_sort’ is defined, that sorts the elements of the list. Once this is done, another method named ‘get_second_largest’ is defined that returns the second element from the end as output.Below is ... Read More

AmitDiwan
2K+ Views
When it is required to merge two lists and sort them, a method can be defined that sorts the list using ‘sort’ method.Below is the demonstration of the same −Example Live Demodef merge_list(list_1, list_2): merged_list = list_1 + list_2 merged_list.sort() return(merged_list) list_1 = [20, 18, 9, 51, ... Read More

AmitDiwan
457 Views
When it is required to find the gravitational force that acts between the two objects, a method named ‘find_gravity’ is used, and three parameters are passed to it.Below is the demonstration of the same −Example Live Demodef find_gravity(m_1, m_2, r): G_val = 6.673*(10**-11) F_val = (G_val*m_1*m_2)/(r**2) return ... Read More

AmitDiwan
1K+ Views
ProblemWe are required to write a JavaScript function that takes in two sorted arrays of numbers our function should merge all the elements of both the arrays into a new array and return that new array sorted in the same order.ExampleFollowing is the code − Live Democonst arr1 = [1, 3, ... Read More

AmitDiwan
187 Views
ProblemWe are required to write a JavaScript function that takes in an array containing a sequence of integers, each element of which contains a possible value ranging between -1 and 1.Our function should return the size of the longest sub-section of that sequence with a sum of zero or higher.ExampleFollowing ... Read More

AmitDiwan
303 Views
ProblemWe are required to write a JavaScript function that takes in a number and return true if the reverse of that number is a prime number, false otherwise.ExampleFollowing is the code − Live Democonst num = 13; const findReverse = (num) => { return +num .toString() .split('') ... Read More