All Posts

Leetcode 1328: Break a Palindrome

Given a string palindrome that is a palindrome, you need to replace exactly one character with any lowercase English letter such that the resulting string is no longer a palindrome. The resulting string should be the lexicographically smallest string possible. If it is not possible to change the string to make it non-palindromic, return an empty string.

Leetcode 1347: Minimum Number of Steps to Make Two Strings Anagram

You are given two strings s and t of the same length. In one step, you can choose any character of t and replace it with another character. Return the minimum number of steps to make t an anagram of s.

Leetcode 1358: Number of Substrings Containing All Three Characters

Given a string s consisting only of characters ‘a’, ‘b’, and ‘c’, your task is to find the number of substrings that contain at least one occurrence of each of the characters ‘a’, ‘b’, and ‘c’.

Leetcode 1366: Rank Teams by Votes

In a special ranking system, each voter assigns a rank to all participating teams in a competition. The rankings are based on the most first-place votes, then second-place votes, and so on. If there is still a tie, teams are ranked alphabetically.

Leetcode 1371: Find the Longest Substring Containing Vowels in Even Counts

Given a string s, find the size of the longest substring containing each vowel (‘a’, ’e’, ‘i’, ‘o’, ‘u’) an even number of times.

Leetcode 1396: Design Underground System

You are tasked with building a system to track customer travel times within an underground railway network. The system should calculate the average time taken to travel between two stations based on previous trips. Implement the UndergroundSystem class with the following methods.