Skip to content

dotun-code-god/even_length_subsets_turing_challenge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

Coding Challenge:

Given a set of numbers k, find all subsets of k such that each has an even number of integers, and then return the sum of all these subsets.
A subset is a contiguous subsequenceof k


Example:

Input: k = [1,4,2,5]
Output: 30
Explanation: The possible subarrays of k and their sums are:
[1,4] = 5
[4,2] = 6
[2,5] = 7
[1,4,2,5] = 12
The sum of all subarrays = 5 + 6 + 7 + 12 = 30


Constraints:

  • 1 <= k.length <= 100
  • 1 <= k[i] <= 1000

About

A coding test challenge by Turing

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages