Skip to content
DeepForgeby svx
All problems
EasyTime Seriests-103

Active Share Lite

Problem

Compute lite active share as half the sum of absolute weight differences: sum(abs(w_portfolio - w_benchmark)) / 2.

Return 0.0 if the weight lists are empty or differ in length. Both weight vectors are assumed to sum to 1.

Hint

0 means an index-hugging portfolio; 1 means no overlap at all.

Test cases

case 1
in: [[0.5,0.3,0.2],[0.4,0.35,0.25]]
expected: 0.09999999999999998
case 2
in: [[1,0],[1,0]]
expected: 0
case 3
in: [[0.6,0.4],[0.4,0.6]]
expected: 0.19999999999999996
case 4
in: [[],[]]
expected: 0
Starter codePython
def active_share_lite(w_portfolio, w_benchmark):
    # Your code here
    pass

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