DEV Community

Cover image for [Devmates.co] Product of Array 🍜 Yelp
Alex Wawl 🐼
Alex Wawl 🐼

Posted on

[Devmates.co] Product of Array 🍜 Yelp

HelloπŸ‘‹,
*My name is Alex and I'm maker of Devmates.co.
😊

We are resolving daily coding problems which asked by top tech companies together. We share our solutions, give some help if anyone stuck, support each other and just hangout together in the internet. πŸ»β˜•οΈπŸ’¬

I get this problem from our members or just searching them in the internet(leetcode forums, Glassdoor, teamblind, etc.). Sometimes this problem can be very easy, sometimes too πŸ‘·β€β™‚οΈhard, everything depends on skills but we are trying to resolve all of them and Have Fun. πŸ™Œ

Today I want to share problem which was asked by 🍜 Yelp.

Problem:

Given non-empty array nums of integers, return an array output such that output[i] is equal to the product of all the elements of nums except nums[i].

Example:

Input: [1,2,3,4]
Output: [1,2,3,4]
Why?
output[0] = 2*3*4 = 24
output[1] = 1*3*4 = 12
output[2] = 1*2*4 = 8
output[3] = 1*2*3 = 6

Top comments (0)