Code Playground

Write & Run Your Own Algorithms

Experiment with JavaScript directly in the browser and compare your results with built-in visualized algorithms.

โœ๏ธ Your Code

Write a function that takes an array of numbers as input and returns a new array. You can use console.log for debugging.

Language
Input array
Reference algorithm

Tip: The function must be named solve and accept (input, console) as parameters.

๐Ÿงพ Output


        

๐Ÿ“Š Comparison

Select a reference algorithm and click "Compare with reference" to see if your output matches.