Given an integer num, your task is to determine if it can be expressed as the sum of three consecutive integers. If it can, return these integers as a sorted array. If not, return an empty array.
You are given the head of a linked list where each segment of the list is separated by nodes with the value 0. Merge the nodes between two consecutive 0 nodes and replace them with a single node whose value is the sum of the nodes in between. The list should not contain any 0 nodes.
You are given an n x n grid and a list of rectangular artifacts buried under it. Each artifact is represented by a list [r1, c1, r2, c2], where (r1, c1) is the top-left corner and (r2, c2) is the bottom-right corner of the artifact. You are also given a list of dig coordinates representing cells in the grid where excavation occurs. Once all parts of an artifact are uncovered, you can extract it. Your task is to return the total number of artifacts that you can fully uncover and extract.
You have n cars on a straight road, each numbered from 0 to n-1 from left to right, with each car positioned at a unique location. You are given a string directions where each character represents the direction of a car (‘L’ for left, ‘R’ for right, and ‘S’ for stationary). Each moving car has the same speed, and the cars can collide under the following conditions: Two cars moving in opposite directions (‘L’ and ‘R’) will collide, counting as 2 collisions. A moving car colliding with a stationary car (‘S’) will result in 1 collision. After a collision, the cars involved stay at the collision point and no longer move. Your task is to calculate the total number of collisions that will happen.
You are given a 0-indexed integer array nums, where each element is a digit between 0 and 9. The triangular sum of nums is computed by repeatedly reducing the array by replacing each element with the sum of two consecutive elements, modulo 10. This process continues until only one element remains, which is the triangular sum. Your task is to return the triangular sum of the array.