title: Minimum Sum Subsequence Least One Every Four Consecutive Elements Picked 1
signature: minimumSumSubsequenceLeastOneEveryFourConsecutiveElementsPicked1 :: [Integer] -> Integer -> Integer
  minimumSumSubsequenceLeastOneEveryFourConsecutiveElementsPicked1 ar n = 
source_py: def minimum_sum_subsequence_least_one_every_four_consecutive_elements_picked_1(ar, n):
      if (n <= 4):
          return min(ar)
      sum = [0 for i in range(n)]
      sum[0] = ar[0]
      sum[1] = ar[1]
      sum[2] = ar[2]
      sum[3] = ar[3]
      for i in range(4, n):
          sum[i] = (ar[i] + min(sum[(i - 4):i]))
      return min(sum[(n - 4):n])
source_cpp: int minimum_sum_subsequence_least_one_every_four_consecutive_elements_picked_1(vector<int> ar, int n) {
    if ( n <= 4 ) return * min_element(ar.begin(), ar.end());
    int sum [ n ];
    sum [ 0 ] = ar [ 0 ];
    sum [ 1 ] = ar [ 1 ];
    sum [ 2 ] = ar [ 2 ];
    sum [ 3 ] = ar [ 3 ];
    for ( int i = 4;
    i < n;
    i ++ ) sum [ i ] = ar [ i ] + ( * min_element ( sum + i - 4, sum + i ) );
    return * min_element ( sum + n - 4, sum + n );
  }