Skip to content
DeepForgeby svx
All problems
HardComputer Visioncv-301

Overlap-Tile Blending

Problem

Blend two overlapping 1D tiles with linear ramp weights.

Keep the non-overlapping left part of the first tile, average the overlap region with weights (t + 1) / (overlap + 1) favoring the second tile, append the remaining right part of the second tile, and round blended values to 4 decimal places.

Test cases

case 1
in: [[1,2,3],[4,5,6],1]
expected: [1,2,3.5,5,6]
case 2
in: [[1,2,3],[4,5,6],2]
expected: [1,2.6667,4.3333,6]
case 3
in: [[1,2,3],[4,5,6],0]
expected: [1,2,3,4,5,6]
Starter codePython
def blend_overlap(left, right, overlap):
    # Your code here
    pass

3 test cases · run your code against them in the editor