Created
December 26, 2014 07:37
-
-
Save davidawad/e2293f2bd589871f2024 to your computer and use it in GitHub Desktop.
Sort of Solution to the Team Formation Challenge on Hackerrank
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.*; | |
import java.util.*; | |
public class Solution { | |
public class Node{ | |
int data; | |
int size = 1; | |
Node next; | |
void append(Node newNode){ | |
if(!newNode){ | |
system.out.println("newNode was NULL"); | |
} | |
size ++ ; | |
next = newNode; | |
newNode.next = null ; | |
} | |
boolean contains(int target){ | |
Node ptr = next; | |
for(int i=0;i<size;i++){ | |
if(ptr.data == target){ | |
return true; | |
} | |
} | |
} | |
} | |
public static void main(String[] args) { | |
Scanner in = new Scanner(System.in); | |
int cases = in.nextInt(); | |
for(int i=0;i<cases;i++){ | |
int smallestTeam, people; | |
people = in.nextInt(); | |
Node[] teams = new Node[people]; | |
for(int j=0;j<people;j++){ | |
} | |
} | |
a = in.nextInt(); | |
sum = solveMeFirst(a, b); | |
System.out.println(sum); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment