AmitDiwan has Published 10744 Articles

Find Equivalent Value and Frequency in Array in JavaScript

AmitDiwan

AmitDiwan

Updated on 22-Jan-2021 07:06:19

96 Views

We are required to write a JavaScript function that takes in an array of integers as the only argument.The function should check whether there exists an integer in the array such that its frequency is same as its value.If there exists at least one such integer, we should return that ... Read More

Special type of sorting algorithm in JavaScript

AmitDiwan

AmitDiwan

Updated on 22-Jan-2021 07:05:11

100 Views

We are required to write a JavaScript function that takes in an array of integers as the only argument.The function should sort the array based on the following conditions −All even numbers are sorted in increasing orderAll odd numbers are sorted in decreasing orderThe relative positions of the even and ... Read More

Calculating a number from its factorial in JavaScript

AmitDiwan

AmitDiwan

Updated on 22-Jan-2021 07:03:19

172 Views

We are required to write a JavaScript function that takes in a number as the only argument.The function should check whether there exists any number whose factorial is the number taken as input.If there exists any such number, we should return that number otherwise we should return -1.For example −If ... Read More

Unique number of occurrences of elements in an array in JavaScript

AmitDiwan

AmitDiwan

Updated on 22-Jan-2021 06:59:06

508 Views

We are required to write a JavaScript function that takes in an array of integers as the first and the only argument.The function should whether all the integers that are present in the array appear for unique number of times or not.If they do, the function should return true, false ... Read More

Finding a number and its nth multiple in an array in JavaScript

AmitDiwan

AmitDiwan

Updated on 22-Jan-2021 06:56:59

201 Views

We are required to write a JavaScript function that takes in an array of integers as the first argument and a number, say n, as the second argument.The function should check whether there exists two such numbers in the array that one is the nth multiple of the other.If there ... Read More

Largest product of n contiguous digits of a number in JavaScript

AmitDiwan

AmitDiwan

Updated on 22-Jan-2021 06:54:53

169 Views

We are required to write a JavaScript function that takes in two numbers as first and the second argument, let us call them m and n.The first number will generally be a number with multiple digits and the second number will always be smaller than the number of digits in ... Read More

Forming and matching strings of an array based on a random string in JavaScript

AmitDiwan

AmitDiwan

Updated on 22-Jan-2021 06:53:25

304 Views

Suppose, we have an array of strings that contains some names like this −const arr = ['Dinesh', 'Mahesh', 'Rohit', 'Kamal', 'Jatin Sapru', 'Jai'];And a random string of characters like this −const str = 'lsoaakjm';We are required to write a JavaScript function that takes in such an array and string as ... Read More

Smallest number of perfect squares that sums up to n in JavaScript

AmitDiwan

AmitDiwan

Updated on 22-Jan-2021 06:51:08

262 Views

We are required to write a JavaScript function that takes in a positive number, say num, as the only argument.The function should find a combination of such perfect square numbers which when added gives the number provided as input. We have to make that we make use of as less ... Read More

Finding the elements of nth row of Pascal's triangle in JavaScript

AmitDiwan

AmitDiwan

Updated on 22-Jan-2021 06:49:35

1K+ Views

Pascal's triangle:Pascal's triangle is a triangular array constructed by summing adjacent elements in preceding rows.The first few elements of Pascals triangle are −We are required to write a JavaScript function that takes in a positive number, say num as the only argument.The function should return an array of all the ... Read More

Explain how a sequential model (Dense Layer) be built in Tensorflow using Python

AmitDiwan

AmitDiwan

Updated on 21-Jan-2021 05:56:32

314 Views

Tensorflow is a machine learning framework that is provided by Google. It is an open−source framework used in conjunction with Python to implement algorithms, deep learning applications and much more. It is used in research and for production purposes.The ‘tensorflow’ package can be installed on Windows using the below line ... Read More

Advertisements