Skip to content

Latest commit

 

History

History

hw02

HW02 - FourSum

Description

Given an integer array with unique integers, calculate the number of combinations where four distinct elements sum to zero.

Examples

Example 1:

Input: A = [-1,1,2,-4,4,8,-3]
Output: 2
Explanation: [1,-1,4,-4], [-1,-4,8,-3]

Example 2:

Input: A = [-1,1,2,-4,4,8,-3]
Output: 3
Explanation: [1,-1,4,-4], [-1,-4,8,-3], [1,1,2,-4]

File Structure

./
├─ firstTry/                        # First Try (some can't work)
├─ FourSum.java                     # Abstract Class
├─ HW02.java                        # Runner
├─ HW02_4111056036_1.java           # Version 1
├─ HW02_4111056036_2.java           # Version 2
├─ HW02_4111056036_3.java           # Version 3
├─ HW02_4111056036_4.java           # Version 4
├─ HW02_4111056036_5.java           # Version 5
├─ StopWatch.java                   # Class for Calculate Runtime
├─ build.sh                         # Compile Script
├─ note.pdf                         # Idea Note
└─ README.md

Score

Best Version

Rank Version Status Time
2/106 HW02_4111056036_4 Correct 0.0036055673999999998

Note: The rank is compared to the best submissions from all participants.

All Versions

Rank Version Status Time
5/354 HW02_4111056036_3 Correct 0.0036484716999999993
6/354 HW02_4111056036_4 Correct 0.0037428424000000003
35/354 HW02_4111056036_5 Correct 0.008897793399999998
40/354 HW02_4111056036_1 Correct 0.0159039868
86/354 HW02_4111056036_2 Correct 0.04228438599999999

Note: The ranks are compared to all submissions from all participants.