This program runs in O(N*M) since str1.contains(s) is O(N) with N = length(str1), M = length(str2)
Using List it takes O(N) only, N = max length of (str1, str2).
I make several classes but compile error shows: /Calculator.java:24: error: class Square is public, should be declared in a file named Square.java
How to compile multitple classes here?
Loading collection data...
This program runs in O(N*M) since
str1.contains(s) is O(N) with N = length(str1), M = length(str2)
Using List it takes O(N) only, N = max length of (str1, str2).
I make several classes but compile error shows:
/Calculator.java:24: error: class Square is public, should be declared in a file named Square.java
How to compile multitple classes here?