Merge two or more trimmed Audio file into single wav file

We need to write a function that can merge two or more audio files and moreover, we are supposed to write a function for trimming the wat every part of the file we want to trim from the complete audio file from different tracks or different files of audio and merge into a single file. If two files have some overlap of time after it’s trimmed then it has to take both trimming parts also.