You are given a list of count-paired domains, where each entry consists of a number followed by a domain name. The number represents the number of visits to that domain. A domain may also have subdomains, and visiting a subdomain also counts as visiting its parent domains. Your task is to return the count of visits for each domain and its subdomains.
You are given an integer array ’nums’ and an integer ‘k’. You can partition the array into at most ‘k’ non-empty adjacent subarrays. The score of a partition is defined as the sum of the averages of each subarray. Your goal is to return the maximum score that can be achieved by partitioning the array in any possible way, with each partition’s score calculated as the sum of averages of its subarrays.
You are given the head of a linked list containing unique integer values, and an array nums which is a subset of the linked list values. A connected component is defined as a sequence of consecutive values in the linked list that all appear in nums. Your task is to return the number of such connected components.
Given an array of words, you are to return the length of the shortest reference string that can encode these words. The reference string consists of the words concatenated with a ‘#’ character at the end, and indices are used to encode the words by identifying their position in the reference string. Each word is encoded by the substring in the reference string that starts at its position and ends at the next ‘#’.
You are given two arrays, fronts and backs, representing the numbers on the front and back of each card. Each card is initially placed with the front number facing up. You may flip any number of cards. An integer is considered ‘good’ if it appears on the back of some card and is not visible on the front of any card after flipping. Your task is to return the minimum possible ‘good’ integer after flipping the cards. If there is no such ‘good’ integer, return 0.
Given an array of unique integers, where each integer is greater than 1, we can create a binary tree using these integers. The value of each non-leaf node must be the product of the values of its children. The goal is to return the number of distinct binary trees that can be constructed. Since the result may be large, return the answer modulo 10^9 + 7.