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 interviewstreet; | |
import java.util.HashMap; | |
import java.util.Scanner; | |
public class Picking_cards { | |
int num; | |
int[] card_nums; | |
HashMap<Integer,Integer> hm=new HashMap<Integer,Integer>(); |
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 interviewstreet; | |
import java.util.Arrays; | |
import java.util.Scanner; | |
public class Permutation { | |
int n; | |
int[][] matrix; | |
int[] set; |
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 interviewstreet; | |
import java.util.Scanner; | |
public class Direct_conn { | |
int num; | |
int[] distance; | |
int[] population; | |
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 interviewstreet; | |
import java.util.ArrayList; | |
import java.util.Scanner; | |
class order | |
{ | |
int Order_id ; | |
int Deal_id; | |
String Email; | |
String City; |
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 interviewstreet; | |
import java.util.Arrays; | |
import java.util.Scanner; | |
public class Permutation { | |
int n; | |
int[][] matrix; | |
int[] set; |
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.util.ArrayList; | |
import java.util.Arrays; | |
import java.util.List; | |
import java.util.Scanner; | |
import java.util.concurrent.Callable; | |
import java.util.concurrent.ExecutionException; | |
import java.util.concurrent.ExecutorService; | |
import java.util.concurrent.Executors; |
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.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) { |
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
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 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.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 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.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>(); |