
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
134 Views
ProblemWe are required to write a JavaScript function that takes in an array of Integers, arr, as the first argument and a single integer, target, as the second argument.For each Integer in the array, our function can either assign ‘+’ or ‘-’ to it.Our function should find out how many ... Read More

AmitDiwan
134 Views
ProblemWe are required to write a JavaScript function that takes in an array of Integers, arr, as the first and the only argument.Our function should count the occurrence of all such index pairs (i, j) that satisfy the following conditions −I < j, andarr[i] > 2 * arr[j]For example, if ... Read More

AmitDiwan
182 Views
ProblemWe are required to write a JavaScript function that takes in a binary array (an array that consists of only 0 and 1), arr, as the only argument. Our function should find the maximum number of consecutive 1s in this array if we can flip at most one 0.For example, ... Read More

AmitDiwan
224 Views
ProblemWe are required to write a JavaScript function that takes in a string str, as the first argument and an Integer, n as the second argument. The string str is composed of alphanumeric characters and dashes.The dashes split the alphanumeric characters within the string into groups. (i.e. if there are ... Read More

AmitDiwan
497 Views
ProblemA magical string str consists of only '1' and '2' and obeys the following rules −The string str is magical because concatenating the number of contiguous occurrences of characters '1' and '2' generates the string str itself.The first few elements of string str is the following −str = "1221121221221121122……"If we ... Read More

AmitDiwan
851 Views
MedianMedian in mathematics, median is the middle value in an ordered(sorted) integer list.If the size of the list is even, and there is no middle value. Median is the mean (average) of the two middle values.ProblemWe are required to write a JavaScript function that takes in an array of Integers, ... Read More

AmitDiwan
249 Views
ProblemWe are required to write a JavaScript function that takes in an array of strings, arr, formed using 0 and 1 only as the first argument.The function takes two numbers as the second and third argument, m and respectively. The task of our function is to find how many strings ... Read More

AmitDiwan
1K+ Views
ProblemWe are required to write a JavaScript function that takes in a string of characters, str, as the only argument. Our function should encode the input string and compare its size with the original string and return the string which is smaller in size.The rule to encode a particular string ... Read More

AmitDiwan
452 Views
Convex PolygonA convex polygon is defined as a polygon with all its interior angles less than 180°.ProblemWe are required to write a JavaScript function that takes in an array of coordinates, basically the array will be an array of arrays each subarray containing exactly two numbers, specifying a point on a ... Read More

AmitDiwan
259 Views
Problemconst random7 = () => Math.ceil(Math.random() * 7);Suppose we have the above fat arrow function. This function yields a random number between 0 (exclusive) and 7 (inclusive) everytime we make a call to it.We are required to write a similar random10() JavaScript function that takes no argument and makes no ... Read More