What do you want to save?
Add Code snippet
New code examples
-
Java 2021-11-13 10:21:19
java program to print unique words in a sentence
import java.util.Arrays; import java.util.HashSet; /** * Java Program - Find Unique Words */ public class Example { public static void main(String[] args) {  ... Add solution -
TypeScript 2021-10-24 04:50:20
how to check how many elements in a set java
import java.util.Arrays; import java.util.HashSet; import java.util.Set; /* check a set size by set.size() */ public class MainClass { public static void main(String[] a) { String elements[] = { "A", "B", "C", "D&... Add solution -
C# 2021-10-14 06:21:10
c# one dimensional dictionary
// constant searching similar to dictionary but not in key/value pair // NOTE: value represents the key itself, you can't store equal values HashSet<T> constantSearch = new HashSet<T>(); var getValue = constantSearch[value as key]; // example... Add solution -
Java 2021-10-12 09:16:13
Java StringBuilder filter same lines
Set<String> tokens = new HashSet<String>(Arrays.asList(s.split("\n"))); StringBuilder resultBuilder = new StringBuilder(); boolean first = true; for(String token : tokens) { if(first) first = false; else resultBuilder.append... Add solution