Refactored all solutions

This commit is contained in:
rshaghoulian
2017-04-05 18:42:35 -05:00
parent 5f4c2f4a78
commit decc8e791e
135 changed files with 848 additions and 849 deletions
@@ -4,18 +4,16 @@
import java.util.Scanner;
/* O(n) runtime. O(1) space. Uses XOR. Keep in mind:
1) x ^ x = 0
2) x ^ 0 = x
3) XOR is commutative and associative
*/
// O(n) runtime. O(1) space. Uses XOR. Keep in mind:
// 1) x ^ x = 0
// 2) x ^ 0 = x
// 3) XOR is commutative and associative
public class Solution {
public static void main(String[] args) {
/* Read input */
public static void main(String [] args) {
/* Save input */
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
int array[] = new int[n];
int [] array = new int[n];
for(int i = 0; i < n; i++){
array[i] = scan.nextInt();
}