Sort by

recency

|

189 Discussions

|

  • + 0 comments

    FOR CRYPTOCURRENCY RECOVERY, CONTACT TSUTOMU SHIMOMURA

    This is the best crypto recovery company I've come across, and I'm here to tell you about it. TSUTOMU SHIMOMURA was able to 5:15 PM 30/12/2024 REGHWGHBHH recover my crypto cash from my crypto investment platform's locked account. TSUTOMU SHIMOMURA just needed 24HRS to restore the $620,000 I had lost in cryptocurrencies. I sincerely appreciate their assistance and competent service. TSUTOMU SHIMOMURA may be relied on since they are dependable and trustworthy. you can also contact them via WEBSITE: https://tsutomushackexpert.com/ or Email address support@tsutomushackexpert.com, and I’m sure you will be happy you did.

  • + 0 comments

    def winningLotteryTicket(tickets): # Convert each ticket to a bitmask freq = {} FULL_MASK = (1 << 10) - 1 # 1023 = 0b1111111111

    for ticket in tickets:
        mask = 0
        for digit in ticket:
            mask |= 1 << int(digit)
        freq[mask] = freq.get(mask, 0) + 1
    
    masks = list(freq.keys())
    count = 0
    
    for i in range(len(masks)):
        for j in range(i, len(masks)):
            if (masks[i] | masks[j]) == FULL_MASK:
                if i == j:
                    # pairs from the same mask: nC2 = n*(n-1)//2
                    count += freq[masks[i]] * (freq[masks[i]] - 1) // 2
                else:
                    # pairs from different masks
                    count += freq[masks[i]] * freq[masks[j]]
    return count
    
  • + 0 comments

    Java 8 solution:

    import java.io.*;
    import java.math.*;
    import java.security.*;
    import java.text.*;
    import java.util.*;
    import java.util.concurrent.*;
    import java.util.function.*;
    import java.util.regex.*;
    import java.util.stream.*;
    import static java.util.stream.Collectors.joining;
    import static java.util.stream.Collectors.toList;
    
    class Result {
    
        /*
         * Complete the 'winningLotteryTicket' function below.
         *
         * The function is expected to return a LONG_INTEGER.
         * The function accepts STRING_ARRAY tickets as parameter.
         */
    
        public static long winningLotteryTicket(List<String> tickets) {
            // Write your code here
            long[] freq = new long[1024]; 
            long answer = 0;
    
            for (String s : tickets) {
                int output = Freq_to_Decimal(s); 
                freq[output]++;
            }
            for (int i = 0; i < 1024; i++) {
                for (int j = i; j < 1024; j++) {
                    if ((i | j) == 1023) {
                        if (i == j) {
                            answer += (freq[i] * (freq[i] - 1)) / 2;
                        } else {
                            answer += freq[i] * freq[j];
                        }
                    }
                }
            }
    
            return answer;
        }
        static int Freq_to_Decimal(String s) {
            int ans = 0;
            for (char c : s.toCharArray()) {
                int bit = c - '0'; 
                ans = ans | (1 << (9 - bit)); 
            }
            return ans;
        }
    }
    
    public class Solution {
        public static void main(String[] args) throws IOException {
            BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));
            BufferedWriter bufferedWriter = new BufferedWriter(new OutputStreamWriter(System.out));
    
            int n = Integer.parseInt(bufferedReader.readLine().trim()); 
    
            List<String> tickets = IntStream.range(0, n).mapToObj(i -> {
                try {
                    return bufferedReader.readLine();
                } catch (IOException ex) {
                    throw new RuntimeException(ex);
                }
            })
            .collect(toList()); 
            long result = Result.winningLotteryTicket(tickets); 
    
            bufferedWriter.write(String.valueOf(result)); 
            bufferedWriter.newLine();
    
            bufferedReader.close();
            bufferedWriter.close();
        }
    }
    
  • + 1 comment

    FOR CRYPTOCURRENCY RECOVERY, CONTACT TSUTOMU SHIMOMURA

    This is the best crypto recovery company I've come across, and I'm here to tell you about it. TSUTOMU SHIMOMURA was able to 5:15 PM 30/12/2024 REGHWGHBHH recover my crypto cash from my crypto investment platform's locked account. TSUTOMU SHIMOMURA just needed 24HRS to restore the $620,000 I had lost in cryptocurrencies. I sincerely appreciate their assistance and competent service. TSUTOMU SHIMOMURA may be relied on since they are dependable and trustworthy. you can also contact them via WEBSITE: https://tsutomushackexpert.com/ or Email address support@tsutomushackexpert.com, and I’m sure you will be happy you did.

  • + 0 comments

    I contacted Steve Wozniak Wizard after being ghosted by a so-called 'crypto recovery service'. Unlike the others, Steve was professional, quick, and incredibly knowledgeable. He recovered $5,300 worth of ETH that I thought was gone for good. Thank you, man! 📧 Contact: stevewozniakwizard(@)gmail.com