Create a module `CustomEnumerable` that implements `map`, `select`, and `reduce` methods without using built-in Enumerable.
HardProblem Statement
Create a module CustomEnumerable that implements map, select, and reduce methods without using built-in Enumerable.
Sample Input
arr = [1, 2, 3]; arr.custom_map { |x| x * 2 }Sample Output
[2, 4, 6]
Limits
Time: 2s · Memory: 256 MB