We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Java
- Strings
- Java Substring Comparisons
- Discussions
Java Substring Comparisons
Java Substring Comparisons
Sort by
recency
|
1759 Discussions
|
Please Login in order to post a comment
solution
import java.util.Scanner;
public class Solution {
}
public static String getSmallestAndLargest(String s, int k) { int length = s.length(); // initialize with the first substring String smallest = s.substring(0, k); String largest = s.substring(0, k);
String smallest = "";
String largest = "";