You are given an integer array. In one move, you can change any element of the array to any value. Perform at most three moves to minimize the difference between the largest and smallest values of the array.
Given a binary string s, return the number of substrings that consist entirely of ‘1’s. Since the result can be large, return the answer modulo (10^9 + 7).
You are given an undirected, weighted graph of n nodes, represented by an edge list, where each edge connects two nodes with a given success probability. Given two nodes, start and end, find the path with the maximum probability of success to go from start to end.
You are given a tree with n nodes, where each node has a label, and your task is to find the number of nodes in the subtree rooted at each node that have the same label as that node.
You are given an array of integers arr. Your task is to count the number of subarrays whose sum is odd. Since the answer can be a large number, return it modulo (10^9 + 7).
You are given a string s. You need to determine the number of valid ways to split s into two non-empty substrings such that the number of distinct letters in the left and right substrings is the same.