Given an integer n, return true if n has exactly three distinct positive divisors. Otherwise, return false. A divisor of n is a positive integer that divides n without leaving a remainder.
Given a string s, you need to remove the minimum possible number of characters to ensure that no character appears three or more times consecutively in the resulting string. The output should be the final string after all necessary deletions.
You are given a string s and an array of strings words. Determine if the string s can be formed by concatenating the first k strings from the array words, for some value of k, where 1 <= k <= words.length. Return true if s is a prefix of words, or false otherwise.
You are given a graph with n vertices labeled from 0 to n-1 (inclusive) and edges connecting pairs of vertices. Your task is to determine if there exists a valid path from a given source vertex to a destination vertex. The graph is undirected, and each pair of vertices is connected by at most one edge. The vertices are connected by edges as given in the input.
You are given a special typewriter with lowercase English letters (‘a’ to ‘z’) arranged in a circle. A pointer initially starts at the character ‘a’. Each second, you may perform one of two operations: move the pointer one character clockwise or counterclockwise, or type the character the pointer is currently on. Your task is to determine the minimum number of seconds needed to type the given string word.