You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
amin e466e7a21a docs: fix typos 4 months ago
..
ExerciseRunner.java docs: adding subject and main 4 months ago
README.md docs: fix typos 4 months ago

README.md

Distinct Substring length

Instructions

Create a class DistinctSubstringLength that provides a method to find the length of the longest substring without repeating characters in a given string.

The distinction between characters should be case-sensitive.

Expected Class

public class DistinctSubstringLength {
    public int maxLength(String s) {
        // Implementation to find the length of the longest substring without repeating characters
    }
}

Usage

Here is a possible ExerciseRunner.java to test your class:

public class ExerciseRunner {
    public static void main(String[] args) {
        DistinctSubstringLength finder = new DistinctSubstringLength();

        // Test cases
        System.out.println(finder.maxLength("abcabcbb")); // Expected output: 3
        System.out.println(finder.maxLength("bbbbb")); // Expected output: 1
        System.out.println(finder.maxLength("pwwkew")); // Expected output: 3
        System.out.println(finder.maxLength("")); // Expected output: 0
    }
}

Expected Output

$ javac *.java -d build
$ java -cp build ExerciseRunner
3
1
3
0
$