What do you want to save?
Add Code snippet
New code examples
-
-
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 -
Javascript 2022-01-27 01:16:08
swap nodes algo hackerrank solution
import java.io.*; import java.math.*; import java.text.*; import java.util.*; import java.util.regex.*; public class Solution { /* * Complete the swapNodes function below. */ static class Node { int index; int depth; ... Add solution -
Other 2021-11-07 09:05:21
ip subnet calculator code
import java.util.*; import java.util.regex.Pattern; import java.math.*; import java.text.NumberFormat; import java.text.ParseException; import java.net.*; public class example { public static void main(String[] args) { Scanner Scan = new Sc... Add solution -
Java 2021-10-09 17:10:08
minimum swaps to sort an array
import java.io.*; import java.math.*; import java.util.*; public class Swap { static int minimumSwaps(int[] arr) { int swap=0; boolean visited[]=new boolean[arr.length]; for(int i=0;i<arr.length;i++){ int j=i,cycle=0; while(!visited[j])... Add solution -
-
Java 2021-09-27 13:13:06
java 8 stream group by example
package com.mkyong.java8; import java.math.BigDecimal; import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.Set; import java.util.stream.Collectors; public class Java8Examples4 { public static void main(String[] ar... Add solution
Best helpers
Mastersulm
+5
Diane
+5
Artmal
+5
Richard D
+5
Any Mouse
+5
RiCo
+5
Adam Clowes
+5
Tushar Diwan
+5
Saforrest
+5
Sinow
+5
Naman
+5
Zelite
+5
I-love-php
+5
Pinakin
+5