Skip to content

Instantly share code, notes, and snippets.

View sinanduman's full-sized avatar

Sinan Duman sinanduman

View GitHub Profile
package teach;
public class FindBalance {
/**
* write a recursion function that will state a given string has balanced
* parenthesis.
*/
public static void main(String[] args) {
String[][] words = {
@sinanduman
sinanduman / ProjectEulerProblem4.java
Created March 5, 2013 10:58
A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 x 99. Find the largest palindrome made from the product of two 3-digit numbers.
package teach;
public class ProjectEulerProblem4 {
/**
* A palindromic number reads the same both ways. The largest palindrome made
* from the product of two 2-digit numbers is 9009 = 91 x 99.
* Find the largest palindrome made from the product of two 3-digit numbers.
*/
private static final int MAX = 999;
@sinanduman
sinanduman / FindAnagram.java
Last active December 13, 2015 18:39
Code will find the anagrams in a given String array.
package teach;
import java.util.Arrays;
public class FindAnagram {
/**
* Develop code that would match words as anagram. If they are anagram
* your code will change last element of each index from null to "T", else "F".
* And print the results.
* E.g. Tea and Eat, ate are anagram words.
@sinanduman
sinanduman / FindReverse.java
Last active December 13, 2015 17:18
The password is the longest substring that is the same in reverse. As an example, if the input was "I like racecars that go fast" the password would be "racecar".
public class FindReverse {
public static void main(String[] args) {
String longWord = "FourscoreandsevenyearsagoourfaathersbroughtforthonthiscontainentanewnationconceivedinzLibertyanddedicatedtothepropositionthatallmenarecreatedequalNowweareengagedinagreahtcivilwartestingwhetherthatnaptionoranynartionsoconceivedandsodedicatedcanlongendureWeareqmetonagreatbattlefiemldoftzhatwarWehavecometodedicpateaportionofthatfieldasafinalrestingplaceforthosewhoheregavetheirlivesthatthatnationmightliveItisaltogetherfangandproperthatweshoulddothisButinalargersensewecannotdedicatewecannotconsecratewecannothallowthisgroundThebravelmenlivinganddeadwhostruggledherehaveconsecrateditfaraboveourpoorponwertoaddordetractTgheworldadswfilllittlenotlenorlongrememberwhatwesayherebutitcanneverforgetwhattheydidhereItisforusthelivingrathertobededicatedheretotheulnfinishedworkwhichtheywhofoughtherehavethusfarsonoblyadvancedItisratherforustobeherededicatedtothegreattdafskremainingbeforeusthatfromthesehonoreddeadwetakeincr