Grasshopper help - tabbing two parts and trimming

Really confused with this task as I am a beginner in Grasshopper.
May I request help with the grasshopper code to do this task?
What I would like to do is tab two cut parts (shown as input - rectangles) using lines and trim them off as shown in the output. I am really stuck on how to code this, from the first step, and I have no idea how trimming works in grasshopper.
If someone could share the grasshopper code for this, it would be a great help for my project.
Thank you!

Two threads about “tabbing” created at the same time by two different people? What are the odds?

hi, still struggling with it !! hope somebody helps