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.util.*; | |
import java.security.*; | |
public class Solution { | |
public static void main(String[] args) { | |
DoNotTerminate.forbidExit(); | |
try { | |
Scanner in = new Scanner(System.in); | |
int n = in .nextInt(); |
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 static void main(String[] args) { | |
Scanner scan = new Scanner(System.in); | |
int i=0; | |
while(scan.hasNextLine()){ | |
String str=scan.nextLine(); |
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.util.*; | |
import java.io.*; | |
import java.math.BigInteger; | |
class Solution{ | |
public static void main(String []argh) | |
{ |
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.util.*; | |
import java.io.*; | |
class Solution{ | |
public static void main(String []argh){ | |
Scanner in = new Scanner(System.in); | |
int t=in.nextInt(); | |
for(int i=0;i<t;i++){ | |
int a = in.nextInt(); | |
int b = in.nextInt(); |
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.util.Scanner; | |
public class Solution { | |
static boolean isAnagram(String a, String b) { | |
// // once you declare a.toUppercase you should assign it to a. you cannot define it as just a.toUppercase... | |
// //I solved it with the long way however I could put a and b in a character array and then use Arrays.sort(arrayname). after this steps convert them to string and check if they are equel. | |
a=a.toUpperCase(); | |
b=b.toUpperCase(); | |
boolean ret = false; | |
StringBuilder c= new StringBuilder(b); |
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 static void main(String[] args) { | |
Scanner sc=new Scanner(System.in); | |
String A=sc.next(); | |
String str="Yes"; |
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.util.Scanner; | |
public class Solution { | |
public static String getSmallestAndLargest(String s, int k) { | |
String smallest = ""; | |
String largest = ""; | |
smallest = s.substring(0,k); | |
largest = s.substring(0,k); | |
// "Compare to" method doesn't turn just the equel case it also turns a value. | |
for(int i=0; i<=s.length()-k; i++ ){ | |
String str = s.substring(i,k+i); |