AmitDiwan has Published 10744 Articles

Finding score of brackets in JavaScript

AmitDiwan

AmitDiwan

Updated on 24-Apr-2021 09:43:01

206 Views

ProblemWe are required to write a JavaScript function that takes in a balanced square bracket string, str, as the first and the only argument.Our function should compute and return the score of the string based on the following rule −[] has score 1AB has a score A + B, where ... Read More

Difference Between PLA and PAL

AmitDiwan

AmitDiwan

Updated on 24-Apr-2021 07:38:08

1K+ Views

In this post, we will understand the difference between PLA and PAL −PLAIt stands for Programmable Logic Array.Its speed is lesser in comparison to PAL.It is highly complex.It is expensive.It is not available easily.It is used less in comparison to PAL.PALIt stands for Programmable Array Logic.It has a higher speed ... Read More

Difference Between SATA and PATA

AmitDiwan

AmitDiwan

Updated on 24-Apr-2021 07:34:43

850 Views

In this post, we will understand the difference between SATA and PATA −PATAIt stands for Parallel Advanced Technology Attachment.It is a 40 pin connector.It is expensive.The speed of data transfer is low.It consumes more power.The size of the cable is big.It doesn’t come with hot swapping feature.External hard drives can’t ... Read More

Difference Between DLP and LCD Projector

AmitDiwan

AmitDiwan

Updated on 24-Apr-2021 07:21:55

311 Views

In this post, we will understand the difference between DLP and LCD projector −DLP Projector (Digital Light Processing)It is a type of projector that uses a digital micro mirror device.One of the chip has a reflective surface that contains thousands of tiny mirrors that are coordinated with a light source.This ... Read More

Difference Between NC and CNC

AmitDiwan

AmitDiwan

Updated on 24-Apr-2021 07:15:59

221 Views

In this post, we will understand the difference between NC and CNC −NC (Numerical Control)It stands for Numerical Control.The input mechanism is punched tapes and punched cards.The modification in the machine programs can be done by changing the information on punched cards.The operational parameters can’t be changed.There is no memory ... Read More

Checking if change can be provided in JavaScript

AmitDiwan

AmitDiwan

Updated on 23-Apr-2021 11:16:52

117 Views

ProblemWe are required to write a JavaScript function that takes in an array of numbers, arr, as the first and the only argument.Let us consider the following situation:A shopkeeper sells a single commodity which costs exactly ₹5. Some customers are standing in a queue and will purchase exactly one unit ... Read More

Maximize first array over second in JavaScript

AmitDiwan

AmitDiwan

Updated on 23-Apr-2021 11:14:06

175 Views

ProblemWe are required to write a JavaScript function that takes in two arrays of numbers, arr1 and arr2, of the same length.Our function should shuffle the elements of the first array, arr1, such that its maximum number of elements are greater than corresponding elements of the array arr2. The function ... Read More

Finding Fibonacci sequence in an array using JavaScript

AmitDiwan

AmitDiwan

Updated on 23-Apr-2021 10:05:48

589 Views

Fibonacci Sequence:A sequence X_1, X_2, ..., X_n is fibonacci if:n >= 3X_i + X_{i+1} = X_{i+2} for all i + 2 {    const map = arr.reduce((acc, num, index) => {       acc[num] = index       return acc    }, {})    const memo = ... Read More

Finding middlemost node of a linked list in JavaScript

AmitDiwan

AmitDiwan

Updated on 23-Apr-2021 09:44:07

132 Views

ProblemWe are required to write a JavaScript function that takes in the head of a linked list as the first and the only argument.Our function should return the value stored in the middlemost node of the list. And if there are two middlemost nodes, we should return the second one ... Read More

Balancing two arrays in JavaScript

AmitDiwan

AmitDiwan

Updated on 23-Apr-2021 09:41:06

383 Views

ProblemWe are required to write a JavaScript function that takes in two arrays of numbers, arr1 and arr2, as the first and the second argument.The sum of elements in arr1 and arr2 are different. Our function should pick one element from the first array and push it in the second ... Read More

Advertisements