Skip to content

Commit

Permalink
revised
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmay committed Feb 6, 2019
1 parent 92bb508 commit 40c9259
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Java/CodingBatExercises/missingChar.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
missingChar("kitten", 4) → "kittn"
*/

public class MissingChar {
public String missingChar (String str, int n) {
if (str.length() == 0 || n > str.length - 1 || n < 0) {
public class Main {
public static String missingChar (String str, int n) {
if (str.length() == 0 || n > str.length() - 1 || n < 0) {
System.err.println("str is an empty string or n is of an invalid the length.");
System.exit(1);
}
return str.substring(0, n) + str.(n, str.length() - 1);
return str.substring(0, n) + str.substring(n, str.length() - 1);
}
public static void main(String[] args) {

Expand Down

0 comments on commit 40c9259

Please sign in to comment.