Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Remove duplicates in string
//'main' method must be in a class 'Rextester'. //Compiler version 1.8.0_111 import java.util.*; import java.lang.*; class Rextester { public static void main(String args[]) { String s1="lovelylikki"; String s2=""; for(int i=0;i<=s1.length()-1;i++) { char ch=s1.charAt(i); int index=s2.indexOf(ch); if(index==-1) { s2=s2+ch; }} System.out.println(s2); }}
run
|
edit
|
history
|
help
0
Le saviez-vous ?
Jumpstatement
LRU cache - Using doubly linked list (Fast!)
anonymous abstract class
BFS in graph
CSV Parser
javaClassAr2
extends
Item battle rolyal
3