Ad
Code
Diff
  • static returnhundred(){
      ([66702978501828] as Random).nextInt()
    }
    
    • public class Solution{
    • public static int returnhundred(){
    • return new java.util.Random(66702978501828L).nextInt();
    • }
    • }
    • static returnhundred(){
    • ([66702978501828] as Random).nextInt()
    • }
Code
Diff
  • import static java.util.stream.Collectors.toMap;
    import static java.util.stream.IntStream.range;
    import static java.util.function.Function.identity;
    import static java.util.Arrays.stream;
    
    class Solution {
        public static int similarPairs(String[] words) {
            return stream(words)
                    .collect(toMap(identity(), x -> 1, Integer::sum))
                    .values()
                    .stream()
                    .mapToInt(x -> x - 1)
                    .sum();
        }
    }
    • import org.junit.jupiter.api.Test;
    • import java.util.HashSet;
    • import java.util.Set;
    • import static java.util.stream.Collectors.toMap;
    • import static java.util.stream.IntStream.range;
    • import static java.util.function.Function.identity;
    • import static java.util.Arrays.stream;
    • class Solution {
    • public static int similarPairs(String[] words) {
    • int num=0;
    • Set<String> seenWords = new HashSet<>();
    • for (String word: words){
    • if (seenWords.contains(word)){
    • num++;
    • }
    • seenWords.add(word);
    • }
    • return num;
    • return stream(words)
    • .collect(toMap(identity(), x -> 1, Integer::sum))
    • .values()
    • .stream()
    • .mapToInt(x -> x - 1)
    • .sum();
    • }
    • }
Code
Diff
  • import java.util.Arrays;
      
    public class Solution {
        public static int addArr(int[] arr){
            return Arrays.stream(arr).sum();
        }
    }
    • function addArr(arr){
    • import java.util.Arrays;
    • if(arr.length === 0) return null
    • let final = 0
    • arr.forEach(num => {
    • final += num
    • })
    • return final
    • public class Solution {
    • public static int addArr(int[] arr){
    • return Arrays.stream(arr).sum();
    • }
    • }
Code
Diff
  • public class Solution{
      public static int returnhundred(){
        return new java.util.Random(66702978501828L).nextInt();
      }
    }
    • fun returnhundred():Int = java.util.Random(66702978501828L).nextInt();
    • public class Solution{
    • public static int returnhundred(){
    • return new java.util.Random(66702978501828L).nextInt();
    • }
    • }
Code
Diff
  • fun returnhundred():Int = java.util.Random(66702978501828L).nextInt();
    
    • function returnhundred() {
    • return 'd'.charCodeAt();
    • }
    • fun returnhundred():Int = java.util.Random(66702978501828L).nextInt();