This file contains 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 interviewstreet; | |
import java.util.Arrays; | |
import java.util.Scanner; | |
public class Solution { | |
int min=1; | |
int val=1; | |
public static void main(String[] args) { |
This file contains 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.File; | |
import java.io.FileNotFoundException; | |
import java.io.FileReader; | |
import java.util.Comparator; | |
import java.util.HashMap; | |
import java.util.Map; | |
import java.util.Scanner; | |
import java.util.TreeMap; | |
class Topfive { |
This file contains 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.gild.puzzles; | |
import java.io.File; | |
import java.io.FileNotFoundException; | |
import java.io.FileReader; | |
import java.util.Scanner; | |
public class Fightsopa { | |
public void process(String input,int n) |
This file contains 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.interviewstreet.puzzles; | |
import java.util.Scanner; | |
public class Solution { | |
public static void main(String[] args) { | |
Scanner scanner; | |
Solution sr = new Solution(); | |
scanner = new Scanner(System.in); | |
int no_cases = scanner.nextInt(); | |
for (int i = 0; i < no_cases; i++) { |
This file contains 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
def solve(str) | |
ary = str.split("") | |
len = ary.length | |
total = 0 | |
for i in 1..(len-1) | |
count = 0 | |
for j in i..(len-1) | |
if ary[j - i] != ary[j] then | |
break | |
end |
This file contains 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.interviewstreet.puzzles; | |
import java.util.ArrayList; | |
import java.util.Scanner; | |
/** | |
* | |
* @author cypronmaya | |
*/ | |
class Point { |
This file contains 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.interviewstreet.puzzles; | |
import java.util.ArrayList; | |
import java.util.Scanner; | |
import java.util.TreeSet; | |
public class find_str { | |
private static final String INVALID = "INVALID"; | |
private TreeSet<String> mainset = new TreeSet<String>(); |
This file contains 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.interviewstreet.puzzles; | |
import java.util.Arrays; | |
import java.util.Scanner; | |
/** | |
* | |
* @author cypronmaya | |
* K Difference - Interviewstreet Challenges (Optimal Solution) | |
*/ | |
public class k_diff { |
This file contains 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
public class Permutations { | |
public static boolean permuteLexically(int[] data) { | |
int k = data.length - 2; | |
while (data[k] >= data[k + 1]) { | |
k--; | |
if (k < 0) { | |
return false; | |
} | |
} |
This file contains 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.util.*; | |
public class Vertical_sticks { | |
public boolean permute(int[] data) { | |
int k = data.length - 2; | |
while (data[k] >= data[k + 1]) { | |
k--; | |
if (k < 0) { |
OlderNewer