You are given two arrays, nums1 and nums2, with integers between 1 and 6. The lengths of the two arrays can differ. In one operation, you can change any element in either array to any value between 1 and 6. The task is to find the minimum number of operations required to make the sums of the two arrays equal. If it is not possible to make the sums equal, return -1.
You are given two strings, s1 and s2, of equal length. A string swap is an operation where you choose two indices in a string (not necessarily different) and swap the characters at these indices. Return true if it is possible to make both strings equal by performing at most one string swap on exactly one of the strings. Otherwise, return false.
You are given an alphanumeric string ’s’, which consists of lowercase English letters and digits. Your task is to find the second largest numerical digit in ’s’. If there is no second largest digit, return -1.
You are tasked with creating an authentication system that handles tokens. Each token has an expiration time, and a user can generate new tokens or renew existing ones before they expire. The system should track and count the number of unexpired tokens at any given time.
You are given a string word consisting of digits and lowercase English letters. Replace every non-digit character with a space and count how many distinct integers are formed after the replacement.
You are given a string s containing several bracket pairs with non-empty keys. You are also provided a 2D array knowledge where each element is a key-value pair. Your task is to evaluate the string by replacing the keys inside the bracket pairs with their corresponding values. If a key is unknown, replace it with a question mark ?.