Posts

Showing posts with the label HackerRank

HackerRank Question

 import java.util.*; import java.util.Scanner; // Write your code here. DO NOT use an access modifier in your class declaration. class Solution { public static void main(String[] args) { // Parser parser = new Parser();          Scanner in = new Scanner(System.in); while (in.hasNext()) { System.out.println(isBalanced(in.next())); }          in.close();          // if(args.length!=0){     //   if(isBalanced(args[0])){     //     System.out.println(args[0]);     //     System.out.println(true);     //   }     //   else {     //     System.out.println(false);     //   }     // } }      public static boolean isBalanced(String in){     Stack<Character> stackVal = new Stack<>();   ...