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 Main { | |
public static String AlphabetSoup(String str) { | |
char[] chars = str.toCharArray(); | |
Arrays.sort(chars); | |
return new String(chars); | |
} | |
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 Main { | |
public static String LongestWord(String sen) { | |
String[] words = sen.split("\\W"); | |
String longest = ""; | |
for (String word : words) | |
longest = word.length() > longest.length() ? word : longest; | |
return longest; |
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 Main { | |
public static String TimeConvert(int num) { | |
return (num / 60) + ":" + (num % 60); | |
} | |
public static void main (String[] args) { | |
// keep this function call here |
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 Main { | |
public static String CheckNums(int num1, int num2) { | |
if (num1 < num2) | |
return "true"; | |
else if (num1 > num2) | |
return "false"; | |
else |
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 Main { | |
public static int SimpleAdding(int num) { | |
return (num == 1) ? 1 : num + SimpleAdding(num - 1); | |
} | |
public static void main (String[] args) { | |
// keep this function call here |
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 Main { | |
public static int FirstFactorial(int num) { | |
return (num == 1) ? num : num * FirstFactorial(num - 1); | |
} | |
public static void main (String[] args) { | |
// keep this function call here |
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.util.regex.Matcher; | |
import java.util.regex.Pattern; | |
class Main { | |
public static String SimpleSymbols(String str) { | |
Pattern regex = Pattern.compile("[a-zA-Z]"); | |
Matcher match = regex.matcher(str); | |
while (match.find()) |
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 Main { | |
public static String LetterCapitalize(String str) { | |
String[] words = str.split(" "); | |
StringBuilder sb = new StringBuilder(); | |
for (String word : words) { // for each word | |
if (Character.isLowerCase(word.charAt(0))) {// if first char is lower case | |
char[] chars = word.toCharArray(); |
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 Main { | |
public static String LetterChanges(String str) { | |
char[] chars = str.toCharArray(); | |
for (int i = 0; i < chars.length; i++) { | |
if (Character.isLetter(chars[i])) | |
if (('a' <= chars[i] && chars[i] < 'z') || ('A' <= chars[i] && chars[i] < 'Z')) | |
chars[i] = (char)(chars[i] + 1); |