Implement Rand10() Using Rand7() Leetcode Solution

Problem Statement: Implement Rand10() Using Rand7() Leetcode Solution –  Given the API rand7() that generates a uniform random integer in the range [1, 7], write a function rand10() that produces a uniform random integer in the range [1, 10]. You can only call the API rand7(), and you shouldn’t call any other …

Read more

Break a Palindrome LeetCode Solution

Problem Statement: Break a Palindrome LeetCode Solution: Given a palindromic string of lowercase English letters palindrome, replace exactly one character with any lowercase English letter so that the resulting string is not a palindrome and that it is the lexicographically smallest one possible. Return the resulting string. If there is no way to replace a character to make …

Read more

The Number of Weak Characters in the Game LeetCode Solution

Problem Statement: The Number of Weak Characters in the Game LeetCode Solution : You are playing a game that contains multiple characters, and each of the characters has two main properties: attack and defense. You are given a 2D integer array properties where properties[i] = [attacki, defensei] represents the properties of the ith character in the game. A character is said …

Read more

Sentence Screen Fitting LeetCode Solution

Problem Statement: Sentence Screen Fitting LeetCode Solution: Given a rows x cols screen and a sentence represented as a list of strings, return the number of times the given sentence can be fitted on the screen. The order of words in the sentence must remain unchanged, and a word cannot be split into two lines. A …

Read more

Minimum Number of Arrows to Burst Balloons LeetCode Solution

Problem Statement: Minimum Number of Arrows to Burst Balloons LeetCode Solution: There are some spherical balloons taped onto a flat wall that represents the XY-plane. The balloons are represented as a 2D integer array points where points[i] = [xstart, xend] denotes a balloon whose horizontal diameter stretches between xstart and xend. You do not know the exact y-coordinates of …

Read more

Translate »