3115. Maximum Prime Difference
You are given an integer array
nums
.Return an integer that is the maximum distance between the indices of two (not necessarily different) prime numbers in
nums
.
3115. Maximum Prime Difference
You are given an integer array
nums
.Return an integer that is the maximum distance between the indices of two (not necessarily different) prime numbers in
nums
.
3114. Latest Time You Can Obtain After Replacing Characters
You are given a string
s
representing a 12-hour format time where some of the digits (possibly none) are replaced with a"?"
.12-hour times are formatted as
"HH:MM"
, whereHH
is between00
and11
, andMM
is between00
and59
. The earliest 12-hour time is00:00
, and the latest is11:59
.You have to replace all the
"?"
characters ins
with digits such that the time we obtain by the resulting string is a valid 12-hour format time and is the latest possible.Return the resulting string.
3113. Find the Number of Subarrays Where Boundary Elements Are Maximum
You are given an array of positive integers
nums
.Return the number of subarrays of
nums
, where the first and the last elements of the subarray are equal to the largest element in the subarray.
3112. Minimum Time to Visit Disappearing Nodes
There is an undirected graph of
n
nodes. You are given a 2D arrayedges
, whereedges[i] = [ui, vi, lengthi]
describes an edge between nodeui
and nodevi
with a traversal time oflengthi
units.Additionally, you are given an array
disappear
, wheredisappear[i]
denotes the time when the nodei
disappears from the graph and you won’t be able to visit it.Notice that the graph might be disconnected and might contain multiple edges.
Return the array
answer
, withanswer[i]
denoting the minimum units of time required to reach nodei
from node 0. If nodei
is unreachable from node 0 thenanswer[i]
is-1
.
3111. Minimum Rectangles to Cover Points
You are given a 2D integer array
points
, wherepoints[i] = [xi, yi]
. You are also given an integerw
. Your task is to cover all the given points with rectangles.Each rectangle has its lower end at some point
(x1, 0)
and its upper end at some point(x2, y2)
, wherex1 <= x2
,y2 >= 0
, and the conditionx2 - x1 <= w
must be satisfied for each rectangle.A point is considered covered by a rectangle if it lies within or on the boundary of the rectangle.
Return an integer denoting the minimum number of rectangles needed so that each point is covered by at least one rectangle.
Note: A point may be covered by more than one rectangle.
You are given a string
s
. The score of a string is defined as the sum of the absolute difference between the ASCII values of adjacent characters.Return the score of
s
.