Adding commas to my integer

I have a very large integer value such as 2874. I wrote a function that can return me a list containing all possible outcomes if I start placing commas between this large integer value. How can i reduce the complexity of this function

Input:

Output:

Explanation:

This is my code:

--

--

Looking for my next opportunity to make change in a BIG way

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store