Skip to content

Instantly share code, notes, and snippets.

View drem-darios's full-sized avatar

Drēm Darios drem-darios

View GitHub Profile
@drem-darios
drem-darios / RotateString.java
Last active June 23, 2020 05:16
Rotates a String at the given index
import java.io.*;
import java.util.*;
/*
* Given an input String and an integer index, rotate the string around the given index
*/
public class RotateString {
public static void main(String[] args) {
@drem-darios
drem-darios / ReverseStringInPlace.java
Last active June 23, 2020 05:25
Reverses a String in place. No extra memory used
import java.io.*;
import java.util.*;
/*
* Reverse a String without using auxilary memory
*/
public class ReverseStringInPlace {
public static void main(String[] args) {
import java.io.*;
import java.util.*;
/*
* To execute Java, please define "static void main" on a class
* named Solution.
*
* If you need more classes, simply define them inline.
*/
@drem-darios
drem-darios / PermutationOfPalindromes.java
Last active October 31, 2020 05:58
Checks if the given String is a permutation of a palendrome
import java.io.*;
import java.util.*;
/*
* To execute Java, please define "static void main" on a class
* named Solution.
*
* If you need more classes, simply define them inline.
*/
import java.io.*;
import java.util.*;
/*
* To execute Java, please define "static void main" on a class
* named Solution.
*
* If you need more classes, simply define them inline.
*/
@drem-darios
drem-darios / MergeArraysNTime.java
Last active March 3, 2017 02:08
Merge two arrays in N time
import java.io.*;
import java.util.*;
/*
* To execute Java, please define "static void main" on a class
* named Solution.
*
* If you need more classes, simply define them inline.
*/
@drem-darios
drem-darios / GetProductExcept.java
Created March 3, 2017 02:22
Multiplies list contents
import java.io.*;
import java.util.*;
/*
* To execute Java, please define "static void main" on a class
* named Solution.
*
* If you need more classes, simply define them inline.
*/
@drem-darios
drem-darios / CountParens.java
Last active June 23, 2020 04:40
Count the number of parenthesis
import java.io.*;
import java.util.*;
/*
* To execute Java, please define "static void main" on a class
* named Solution.
*
* If you need more classes, simply define them inline.
*/
import java.io.*;
import java.util.*;
/*
* To execute Java, please define "static void main" on a class
* named Solution.
*
* If you need more classes, simply define them inline.
*/
@drem-darios
drem-darios / BestTrade.java
Created March 3, 2017 02:25
Figures out the best trade in a few days
import java.io.*;
import java.util.*;
/*
* To execute Java, please define "static void main" on a class
* named Solution.
*
* If you need more classes, simply define them inline.
*/