Draft
3-Sum
12smiks
Description:
Your task is to find 3 smallest numbers that add up to n.
You will receive 2 arguments. List filled with positive integers and n.
List will have length ℓ
Return [-1] if solution is not possible.
Input data
100 ℓ ≤ 200000
Example
program([1,2,3,4,5], 10)
Solution
``` [1,4,5] ```
l = [2,4,2,5,7,8,4,12,3,57,8,2,21,1,4,56,7,8,4,2,1,2,4,5,7,85,9,7,9,2]
program(l, 24)
# output [1, 2, 21]
Algorithms
Data Structures
Similar Kata:
Stats:
Created | Mar 20, 2017 |
Warriors Trained | 119 |
Total Skips | 3 |
Total Code Submissions | 486 |
Total Times Completed | 12 |
Python Completions | 12 |
Total Stars | 5 |
% of votes with a positive feedback rating | 55% of 10 |
Total "Very Satisfied" Votes | 5 |
Total "Somewhat Satisfied" Votes | 1 |
Total "Not Satisfied" Votes | 4 |
Total Rank Assessments | 8 |
Average Assessed Rank | 5 kyu |
Highest Assessed Rank | 4 kyu |
Lowest Assessed Rank | 7 kyu |