Insertion Sort Problem

Insertion Sort Problem — ExecCode Easy DSA Practice

Solve the Insertion Sort problem on ExecCode. Free online easy DSA practice in Sort. Write and run code in Java, C++, Python — no signup required to run.

Problem description

Description You are given the input needed to solve Insertion Sort. Your task is to compute the required answer and return sorted numbers, space-separated. A search space contains many possible answers. In Insertion Sort, the challenge is to narrow that space intelligently instead of trying every possibility blindly. nums space-separated on one line.

Examples

Input {"nums": [5, 2, 8, 1, 9]}; Output 1 2 5 8 9. Input {"nums": [10, 9, 8, 7, 6, 5, 4, 3, 2, 1]}; Output 1 2 3 4 5 6 7 8 9 10. Input {"nums": [1, 2, 3, 4, 5]}; Output 1 2 3 4 5

Constraints

1 <= len(nums) <= 10^4

Practice Insertion Sort free on ExecCode. Browse DSA problems, topic map, and placement guides.