## LeetCode # 2 -Add Two Numbers

My submission for LeetCode Add Two Numbers problem:

```
public class Solution {
public ListNode addTwoNumbers(ListNode l1, ListNode l2) {
ListNode retVal = new ListNode(0);
int carry = 0;
while(l1 != null || l2 != null){
int temp = carry;
if(l1 == null){
temp += l2.val;
l2 = l2.next;
} else if (l2 == null){
temp += l1.val;
l1 = l1.next;
} else {
temp += l1.val + l2.val;
l1 = l1.next;
l2 = l2.next;
}

if(temp >= 9){
carry = 1;
temp = temp - 10;
} else {
carry = 0;
}

retVal.val = temp;
if(l1 != null || l2 != null){
retVal.next = new ListNode(0);
retVal = retVal.next;
} else if(carry == 1){
retVal.next = new ListNode(1);
retVal = retVal.next;
}
}
}
}

```

## LeetCode #1 – Two Sum

This is my submission for LeetCode Two Sum Problem:

```public class Solution {
public int[] twoSum(int[] nums, int target) {
int i;
int j;
for(i = 0; i <= nums.length; i++){
for(j = i+1; j <= nums.length; j++){
if(nums[i]+nums[j] == target){
int[] data = {i,j};
return data;
}
}
}
return null;
}
}
```

## Check if a String has all unique characters

Just a random algorithm post

```public static boolean checkStringUniqueCharacters(String str){
HashSet hs = new HashSet();
char[] chars = str.toCharArray();

for(int i = 0; i &lt; chars.length; i++){
if(hs.contains(chars[i])){
return false;
} else {
}
}
return true;
}
```

Lulz

## Go – Hello World

```package main

import "fmt"

func main() {
fmt.Println("hello world")
}

```