What do you want to save?
Add Code snippet
New code examples
-
Java 2021-10-11 12:15:02
convert hashset to int array java
import java.util.Arrays; import java.util.Set; import java.util.HashSet; class Main { // Program to convert set of integer to array of int in Java public static void main(String args[]) &nb... Add solution -
Java 2021-10-09 08:22:14
how to set two different table admin and user for separate jwt token in spring boot
private Set getAuthority(User user) { Set authorities = new HashSet<>(); user.getRoles().forEach(role -> { authorities.add(new SimpleGrantedAuthority("ROLE_" + role.getName())); }); return authorities; } Add solution -
Other 2021-10-06 08:14:04
first repeating character in a string
// C# program to find the first // repeated character in a string using System; using System.Collections.Generic; class GFG { // This function prints the first // repeated character in str[] public static char firstRepeating(char[] str) { &nb... Add solution -
Java 2021-10-05 21:26:04
set to list java
Set<Foo> foo = new HashSet<Foo>(myList); Add solution -
Java 2021-10-04 17:25:02
arraylist to set java 8
Set<Foo> foo = new HashSet<Foo>(myList); Add solution -
Java 2021-10-02 18:47:06
HashSet Object clone() method in java
import java.util.HashSet; public class HashSetObjectCloneMethodExample { public static void main(String[] args) { HashSet<String> hs = new HashSet<String>(); hs.add("Welcome"); hs.add("hello"); ... Add solution -
C# 2021-09-28 20:38:03
How to Insert or Delete Elements to Collection During Iteration in c#
// one of many possibilities is to use another collection // for other possibilities see: //https://www.techiedelight.com/remove-elements-from-list-while-iterating-csharp/ // or: // https://stackoverflow.com/questions/1582285/how-to-remove-elements-from... Add solution -
Java 2021-09-15 12:44:03
smallest positive integer not in array java
If the expected running time should be linear, you can't use a TreeSet, which sorts the input and therefore requires O(NlogN). Therefore you should use a HashSet, which requires O(N) time to add N elements. Besides, you don't need 4 loops. It's sufficien... Add solution