Alice has a rope with balloons arranged in a sequence where each balloon has a color. She wants the rope to be colorful, meaning no two consecutive balloons should have the same color. Bob is tasked with helping Alice by removing some balloons. Each balloon has an associated cost, and Bob needs to minimize the total time spent removing the balloons to achieve the desired colorful sequence. Return the minimum time Bob needs to make the rope colorful.
Given a string s, your task is to split it into the maximum number of non-empty substrings such that all substrings are unique. You are allowed to split the string in any way, but each substring in the split must not repeat.
You are working with a file system that logs folder change operations. The file system starts in the main folder, and the operations allow the user to move to a parent folder, remain in the current folder, or navigate to a child folder. Given a list of operations, your task is to determine the minimum number of operations required to return to the main folder after performing all the operations.
Employees use key-cards to unlock office doors, and the system records the time of each use. An alert is triggered if a worker uses their key-card three or more times within a one-hour period.
You are given two strings, a and b, of the same length. You need to split both strings at the same index into two parts: one prefix and one suffix for each string. Then, check if concatenating one prefix from one string with the suffix of the other string forms a palindrome. Specifically, you need to check if either aprefix + bsuffix or bprefix + asuffix forms a palindrome.
Given a string s, find the length of the longest substring between two equal characters, excluding the two characters themselves. If no such substring exists, return -1.