This problem was asked by Facebook. There is an N by M matrix of zeroes. Given N and M, write a function to count the number of ways of starting at the top left corner and getting to the bottom right
Implement division of two positive integers without using the division, multiplication, or modulus operators. Return the quotient as an integer, ignoring the remainder. Idea behind the solution The id
This problem was asked by Amazon. Given a string s and an integer k, break up the string into multiple lines such that each line has a length of k or less. You must break it up so that words don t bre
This problem was asked by Google. Implement an LRU Least Recently Used cache. It should be able to be initialized with a cache size n, and contain the following methods set key, value sets key to valu
This problem was asked by Google. A knight s tour is a sequence of moves by a knight on a chessboard such that all squares are visited once. Given N, write a function to return the number of knight s
This problem was recently asked by Twitter You are given an array of integers. Find the maximum sum of all possible contiguous subarrays of the array. Example 34, 50, 42, 14, 5, 86 Given this input ar
This problem was asked Microsoft. Using a read7 method that returns 7 characters from a file, implement readN n which reads n characters. For example, given a file with the content “Hello world”, th
This problem was asked by Microsoft. Given a 2D matrix of characters and a target word, write a function that returns whether the word can be found in the matrix by going left to right, or up to down.
This problem was asked by Microsoft. Implement a URL shortener with the following methods shorten url , which shortens the url into a six character alphanumeric string, such as zLg6wl. restore short ,
This problem was asked by Microsoft. Suppose an arithmetic expression is given as a binary tree. Each leaf is an integer and each internal node is one of + , − , ∗ , or . Given the root to such a tree
This problem was asked by Microsoft. A number is considered perfect if its digits sum up to exactly 10. Given a positive integer n, return the n th perfect number. For example, given 1, you should ret
This problem was asked by Google. Given the root of a binary tree, return a deepest node. For example, in the following tree, return d. a b c d Idea behind the solution For this problem we just need t
This problem was recently asked by Google Given a list of numbers with only 3 unique numbers 1, 2, 3 , sort the list in O n time. Example 1 Input 3, 3, 2, 1, 3, 2, 1 Output 1, 1, 2, 2, 3, 3, 3
This problem was asked by Facebook. Given a list of integers, return the largest product that can be made by multiplying any three integers. For example, if the list is 10, 10, 5, 2 , we should retur
This problem was asked by Facebook. Given a array of numbers representing the stock prices of a company in chronological order, write a function that calculates the maximum profit you could have made
Here s your coding interview problem for today. This problem was asked by Amazon. Given a N by M matrix of numbers, print out the matrix in a clockwise spiral. For example, given the following matrix
Naturally, we humans are happy to see other people in danger, Which is not desirable at all, This project is like my protest against this type of mentality. This is a very simple but cute looking Anim
Prettier is an opinionated code formatter which support many languages. In this example we will see how to prettify java code. NPM Modules We need Prettier Prettier Java NPM Installation npm install s
Here s a simple downloadFile function to download any file using axios in Node JS How To Implement the Axios File Download in Node js Axios is a great http library for both browser and node js If you
H Index II is an example of Array problems In this post we will see how we can solve it in Javascript Problem Description H Index II Given an array of citations sorted in ascending order each citation
Recent comments on javascript
Fantastic work, I used this
The recursive solution will require an additional check as just existing does not fu
Hi, I ve tried your method but it seems to be having the same issue as others. Here
May i have the error log please?
Can u please Check on this , I am unable to Find any solution, I have used import as
Or use this config file, make sure you have a confige.json file for ORM configuratio
use strict const fs require fs const path require path const Sequelize require sequ
make sure that you are using the default config file or recreate the config file.
Please make sure you are using the default config or recreate the config file.
Hi I am new in Node js and facing same issue, I am unable to solve it with your meth