#Codidact developer here - AFAIK all content on SO is licensed under CC BY-SA, so copying over the question should be ok w/ attribution.
Although if you have time to possibly improve/generalize the question, that would be great too of course :D
See also: https://meta.codidact.com/posts/277998/288937#answer-288937