Exercises/#4 Product of Array Except Self
#4

Product of Array Except Self

MediumπŸ“¦ Arrays
80 XP

Problem

Given an integer array nums, return an array where each element is the product of all other elements. Solve without division in O(n) time.

Examples

Input: nums = [1,2,3,4]
Output: [24,12,8,6]

Input: nums = [-1,1,0,-3,3]
Output: [0,0,9,0,0]
prefix-sumarray
AI Assistantβ€” powered by AI

Unlock hints progressively β€” start gentle, go deeper only if needed.

πŸ’‘

Level 1: Gentle Nudge

A subtle direction

πŸ—ΊοΈ

Level 2: Approach

The algorithm to use

πŸ”

Level 3: Detailed

Step-by-step guidance

4 / 150

Your Solution

⚑ JavaScript

to save progress and use AI features