Sobes.tech
Junior — Senior

Method that returns an array without duplicate elements in the original order without LINQ

livecode

Task condition

Write a function (without using LINQ) that takes an array of integers and returns a new array with all duplicates removed, while preserving the original order of elements.

int[] Distinct(int[] source)
// [1,2,5,3,3,2] → [1,2,5,3]