leetcode75 43

[LeetCode 75] Medium - 334. Increasing Triplet Subsequence ☆

334. Increasing Triplet Subsequence Given an integer array nums, return true if there exists a triple of indices (i, j, k) such that i  and nums[i]  false. Example 1:Input: nums = [1,2,3,4,5]Output: trueExplanation: Any triplet where i Example 2:Input: nums = [5,4,3,2,1]Output: falseExplanation: No triplet exists.Example 3:Input: nums = [2,1,5,0,4,6]Output: trueExplanation: The triplet (3, 4, 5)..

LeetCode/LeetCode75 2024.11.12

[LeetCode 75] Medium - 238. Product of Array Except Self ☆

238. Product of Array Except Self Given an integer array nums, return an array answer such that answer[i] is equal to the product of all the elements of nums except nums[i].The product of any prefix or suffix of nums is guaranteed to fit in a 32-bit integer.You must write an algorithm that runs in O(n) time and without using the division operation. Example 1:Input: nums = [1,2,3,4]Output: [24,12..

LeetCode/LeetCode75 2024.11.11

[LeetCode 75] Easy - 345. Reverse Vowels of a String

345. Reverse Vowels of a String Given a string s, reverse only all the vowels in the string and return it.The vowels are 'a', 'e', 'i', 'o', and 'u', and they can appear in both lower and upper cases, more than once. Example 1:Input: s = "IceCreAm"Output: "AceCreIm"Explanation:The vowels in s are ['I', 'e', 'e', 'A']. On reversing the vowels, s becomes "AceCreIm".Example 2:Input: s = "leetcode"O..

LeetCode/LeetCode75 2024.11.11

[LeetCode 75] Medium - 1071. Greatest Common Divisor of Strings ☆

1071. Greatest Common Divisor of Strings For two strings s and t, we say "t divides s" if and only if s = t + t + t + ... + t + t (i.e., t is concatenated with itself one or more times).Given two strings str1 and str2, return the largest string x such that x divides both str1 and str2. Example 1:Input: str1 = "ABCABC", str2 = "ABC"Output: "ABC"Example 2:Input: str1 = "ABABAB", str2 = "ABAB"Outpu..

LeetCode/LeetCode75 2024.11.11