This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.*; | |
import java.util.*; | |
import java.text.*; | |
import java.math.*; | |
import java.util.regex.*; | |
public class Solution { | |
public static void main(String[] args) { | |
Scanner in = new Scanner(System.in); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
boolean areSimilar(int[] A, int[] B) { | |
ArrayList<Position> mismatchedPosition = new ArrayList<>(); | |
for(int i = 0; i < A.length; i++){ | |
int a = A[i]; | |
int b = B[i]; | |
if(a != b){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String reverseParentheses(String s) { | |
Stack<ParenPair> openingParen = new Stack<>(); | |
Queue<ParenPair> fullParenPair = new LinkedList<>(); | |
StringBuilder sentence = new StringBuilder(s); | |
for(int i = 0; i < s.length(); i++) { | |
char c = s.charAt(i); | |
if(c == '('){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int shapeArea(int n) { | |
int numMiddleBoxes = 1 + (2 * (n-1)); | |
int leftsideArea = 0; | |
int boxesToAdd = numMiddleBoxes-2; | |
while(boxesToAdd >= 1) { | |
leftsideArea += boxesToAdd; | |
boxesToAdd -= 2; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.content.Context; | |
import android.support.v4.app.Fragment; | |
import java.util.HashMap; | |
/** | |
* Created by ekuivi on 8/24/16. | |
* | |
* Singleton object that makes it easy to pass object references between activities |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.goeshow.barcodescanner.utils.objectReferenceMap; | |
import android.content.Context; | |
import android.support.v4.app.Fragment; | |
import java.util.HashMap; | |
/** | |
* Created by ekuivi on 8/24/16. | |
* |