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 Solution { | |
static int[] hackerCards(int[] collection, int d) { | |
List<Integer> result = new ArrayList<>(); | |
int s, e; | |
for(int idx = 0; idx <= collection.length; idx++) { | |
if (idx == 0) s = 1; else s = collection[idx-1] + 1; | |
if (idx != collection.length) e = collection[idx]; else e = Integer.MAX_VALUE; | |
if (d < s) break; | |
for (int k = s; k < e; k++) { | |
if (k <= d) { |
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 SetFromListPerfTest { | |
@Test | |
public void listToLinkedHashSetTest() throws Exception { | |
final List<byte[]> data = buildListData(); | |
doTest(new Callback() { | |
@Override | |
public String name() { |