What do you want to save?
Add Code snippet
New code examples
-
Python 2022-01-29 20:05:38
python adding and subtracting sets
a = {10,20,30,40} b = {30,40,50,60} print(a & b) print(a.intersection(b)) #OUTPUT #{30,40} print(a | b) print(a.union(b)) #OUTPUT #{10,20,30,40,50,60} print(a - b) print(a.difference(b)) #OUTPUT #{10,20} print(b - a) print(b.difference(a)) #OUTPU... Add solution -
Java 2022-01-28 21:07:43
Java Find the greatest common divisor of two positive integers. The integers can be large, so you need to find a clever solution.
import static java.math.BigInteger.valueOf; import java.math.BigInteger; public class GCD { public static int compute(int x, int y) { return valueOf(x).gcd(valueOf(y)).intValue(); } } Code language: Java (java) Add solution -
C# 2022-01-26 16:31:12
c# get username of process
//----------------------------------------- // Very fast non-WMI process username search // import System.Security.Principal // and System.Runtime.InteropServices // for this to work //----------------------------------------- private static string GetP... Add solution -
Javascript 2022-01-26 06:50:47
nestjs controller
import { Controller, Get, Post, Body } from '@nestjs/common'; import { CreateCatDto } from './dto/create-cat.dto'; import { CatsService } from './cats.service'; import { Cat } from './interfaces/cat.interface'; @Controller('cats') export class CatsContr... Add solution
Best helpers
Ranking is empty