online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
/****************************************************************************** Welcome to GDB Online. GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl, C#, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog. Code, Compile, Run and Debug online from anywhere in world. *******************************************************************************/ import java.util.*; import java.util.stream.Collectors; import java.util.stream.Stream; public class Main { public static void main(String[] args) { var text1 = "edificio1,matematicas,M\n" + "edificio1,español,M\n" + "edificio1,ingles,M\n" + "edificio2,ingles,M\n" + "edificio2,matematicas,M\n" + "edificio4,ingles,M"; var text2 = "edificio2,ingles,V\n" + "edificio2,matematicas,V\n" + "edificio5,ingles,V"; List<String> list1 = getLines( text1 ); List<String> list2 = getLines( text2 ); Set<String> set1 = list1.stream().map( s -> s.split( "," )[0] ).collect( Collectors.toSet() ); Set<String> set2 = list2.stream().map( s -> s.split( "," )[0] ).collect( Collectors.toSet() ); Map<Boolean, List<String>> result = Stream.concat( list1.stream(), list2.stream() ) .collect( Collectors.partitioningBy( s -> { String key = s.split( "," )[0]; return set1.contains( key ) && set2.contains( key ); } ) ); var duplicados = result.get( true ); var distintos = result.get( false ); System.out.println( "Listas de Duplicados :" ); duplicados.forEach( System.out::println ); System.out.println( "\nListas de Distintos :" ); distintos.forEach( System.out::println ); } private static List<String> getLines(String string) { List<String> list = new ArrayList<>(); Scanner scanner = new Scanner( string ); while (scanner.hasNextLine()) { list.add( scanner.nextLine() ); } scanner.close(); return list; } }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue