Created
May 17, 2019 04:24
Revisions
-
alejandrolechuga created this gist
May 17, 2019 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ class Main { public static void main(String[] args) { Main.func("Hello world!"); } public static void func(String str) { String output = ""; for (int i = 0; i < str.length(); i++) { char character = str.charAt(i); if (output.indexOf(character) == -1){ output += character; } } System.out.println(output); } }