All Posts

Leetcode 2481: Minimum Cuts to Divide a Circle

You are given a circle, and you need to divide it into ’n’ equal slices using the minimum number of straight cuts. A valid cut can either be through the center of the circle touching two points on the edge or touching just one point and the center.

Leetcode 2485: Find the Pivot Integer

Given a positive integer n, you are tasked with finding an integer x such that the sum of all integers from 1 to x is equal to the sum of all integers from x to n, inclusive. If no such integer exists, return -1. It is guaranteed that there will be at most one solution for the given input.

Leetcode 2490: Circular Sentence

You are given a sentence where words are separated by spaces. A sentence is considered circular if the last character of each word matches the first character of the next word, and the last character of the last word matches the first character of the first word.

Leetcode 2496: Maximum Value of a String in an Array

Given an array of alphanumeric strings, you are tasked with determining the maximum value of any string in the array. The value of a string is determined in the following way: If the string consists only of digits, its value is its numeric representation in base 10. If it contains any letters, its value is the length of the string.

Leetcode 2500: Delete Greatest Value in Each Row

You are given a matrix grid with positive integers. In each operation, remove the greatest value from each row, and if multiple elements have the same greatest value, remove any one of them. After removing the greatest value from all rows, add the maximum of these values to the answer. The number of columns decreases by one after each operation. Perform these operations until the grid is empty, and return the sum of the maximum values from all operations.

Leetcode 2506: Count Pairs Of Similar Strings

You are given a list of words, where each word consists of lowercase English letters. Two words are considered similar if they contain the exact same set of unique characters, regardless of the order. Your task is to count how many pairs of words (i, j) satisfy the condition where both words have the same set of unique characters. Return the count of such pairs (i, j) where 0 ≤ i < j ≤ len(words) - 1.