Skip to content

Latest commit

 

History

History
14 lines (10 loc) · 476 Bytes

File metadata and controls

14 lines (10 loc) · 476 Bytes

Problem 15: The Flattening Force (Flatten Nested List)

Problem Statement

You are given a nested list of integers. Each element is either an integer or a list — whose elements may also be integers or other lists. Implement a function to flatten it into a single list using recursion.

Input Format

  • A nested list of integers.

Example

Input: nestedList = [[1,1],2,[1,1]]
Output: [1,1,2,1,1]

Input: nestedList = [1,[4,[6]]]
Output: [1,4,6]