2737. Find the Closest Marked Node
You are given a positive integer
nwhich is the number of nodes of a 0-indexed directed weighted graph and a 0-indexed 2D arrayedgeswhereedges[i] = [ui, vi, wi]indicates that there is an edge from nodeuito nodeviwith weightwi.You are also given a node
sand a node arraymarked; your task is to find the minimum distance fromsto any of the nodes inmarked.Return an integer denoting the minimum distance from
sto any node inmarkedor-1if there are no paths from s to any of the marked nodes.
2674. Split a Circular Linked List
Given a circular linked list
listof positive integers, your task is to split it into 2 circular linked lists so that the first one contains the first half of the nodes inlist(exactlyceil(list.length / 2)nodes) in the same order they appeared inlist, and the second one contains the rest of the nodes inlistin the same order they appeared inlist.Return an array answer of length 2 in which the first element is a circular linked list representing the first half and the second element is a circular linked list representing the second half.
A circular linked list is a normal linked list with the only difference being that the last node’s next node, is the first node.
2743. Count Substrings Without Repeating Character
You are given a string
sconsisting only of lowercase English letters. We call a substring special if it contains no character which has occurred at least twice (in other words, it does not contain a repeating character). Your task is to count the number of special substrings. For example, in the string"pop", the substring"po"is a special substring, however,"pop"is not special (since'p'has occurred twice).Return the number of special substrings.
A substring is a contiguous sequence of characters within a string. For example,
"abc"is a substring of"abcd", but"acd"is not.
2753. Count Houses in a Circular Street II
You are given an object
streetof classStreet``kwhich represents a maximum bound for the number of houses in that street (in other words, the number of houses is less than or equal tok). Houses’ doors could be open or closed initially (at least one is open).Initially, you are standing in front of a door to a house on this street. Your task is to count the number of houses in the street.
The class
Streetcontains the following functions which may help you:
void closeDoor(): Close the door of the house you are in front of.boolean isDoorOpen(): Returnstrueif the door of the current house is open andfalseotherwise.void moveRight(): Move to the right house.
1ton, then the right house ofhouseiishousei+1fori < n, and the right house ofhousenishouse1.Return
answhich represents the number of houses on this street.
2714. Find Shortest Path with K Hops
You are given a positive integer
nwhich is the number of nodes of a 0-indexed undirected weighted connected graph and a 0-indexed 2D arrayedgeswhereedges[i] = [ui, vi, wi]indicates that there is an edge between nodesuiandviwith weightwi.You are also given two nodes
sandd, and a positive integerk, your task is to find the shortest path fromstod, but you can hop over at mostkedges. In other words, make the weight of at mostkedges0and then find the shortest path fromstod.Return the length of the shortest path from
stodwith the given condition.
2702. Minimum Operations to Make Numbers Non-positive
You are given a 0-indexed integer array
numsand two integersxandy. In one operation, you must choose an indexisuch that0 <= i < nums.lengthand perform the following:
- Decrement
nums[i]byx.- Decrement values by
yat all indices except theithone.Return the minimum number of operations to make all the integers in
numsless than or equal to zero.