본문 바로가기

LeetCode342

leetcode 2894. Divisible and Non-divisible Sums Difference https://leetcode.com/problems/divisible-and-non-divisible-sums-difference/description/ Divisible and Non-divisible Sums Difference - LeetCode Can you solve this real interview question? Divisible and Non-divisible Sums Difference - You are given positive integers n and m. Define two integers, num1 and num2, as follows: * num1: The sum of all integers in the range [1, n] that are not divisible by.. 2024. 1. 5.
leetcode 2974. Minimum Number Game https://leetcode.com/problems/minimum-number-game/description/ Minimum Number Game - LeetCode Can you solve this real interview question? Minimum Number Game - You are given a 0-indexed integer array nums of even length and there is also an empty array arr. Alice and Bob decided to play a game where in every round Alice and Bob will do one move. Th leetcode.com 1234567891011121314class Solution:.. 2024. 1. 5.
leetcode 2643. Row With Maximum Ones https://leetcode.com/problems/row-with-maximum-ones/description/ Row With Maximum Ones - LeetCode Can you solve this real interview question? Row With Maximum Ones - Given a m x n binary matrix mat, find the 0-indexed position of the row that contains the maximum count of ones, and the number of ones in that row. In case there are multiple rows that ha leetcode.com 1234567891011class Solution: d.. 2024. 1. 2.
leetcode 2788. Split Strings by Separator https://leetcode.com/problems/split-strings-by-separator/description/ Split Strings by Separator - LeetCode Can you solve this real interview question? Split Strings by Separator - Given an array of strings words and a character separator, split each string in words by separator. Return an array of strings containing the new strings formed after the splits, excl leetcode.com 123456789class Solut.. 2024. 1. 2.
leetcode 2824. Count Pairs Whose Sum is Less than Target https://leetcode.com/problems/count-pairs-whose-sum-is-less-than-target/description/ Count Pairs Whose Sum is Less than Target - LeetCode Can you solve this real interview question? Count Pairs Whose Sum is Less than Target - Given a 0-indexed integer array nums of length n and an integer target, return the number of pairs (i, j) where 0 int: answer = 0 for i in range(len(nums)): for j in range(.. 2024. 1. 2.
leetcode 2729. Check if The Number is Fascinating https://leetcode.com/problems/check-if-the-number-is-fascinating/description/ Check if The Number is Fascinating - LeetCode Can you solve this real interview question? Check if The Number is Fascinating - You are given an integer n that consists of exactly 3 digits. We call the number n fascinating if, after the following modification, the resulting number contains all the digi leetcode.com 1234.. 2023. 12. 29.
leetcode 2903. Find Indices With Index and Value Difference I https://leetcode.com/problems/find-indices-with-index-and-value-difference-i/description/ Find Indices With Index and Value Difference I - LeetCode Can you solve this real interview question? Find Indices With Index and Value Difference I - You are given a 0-indexed integer array nums having length n, an integer indexDifference, and an integer valueDifference. Your task is to find two indices i .. 2023. 12. 28.
leetcode 2923. Find Champion I https://leetcode.com/problems/find-champion-i/description/ Find Champion I - LeetCode Can you solve this real interview question? Find Champion I - There are n teams numbered from 0 to n - 1 in a tournament. Given a 0-indexed 2D boolean matrix grid of size n * n. For all i, j that 0 2023. 12. 28.
leetcode 2697. Lexicographically Smallest Palindrome https://leetcode.com/problems/lexicographically-smallest-palindrome/description/ 1234567891011class Solution: def makeSmallestPalindrome(self, s: str) -> str: s = list(s) for i in range(len(s)//2): if s[i] != s[-(i+1)]: if s[i] 2023. 12. 28.
leetcode 2828. Check if a String Is an Acronym of Words https://leetcode.com/problems/check-if-a-string-is-an-acronym-of-words/description/ Check if a String Is an Acronym of Words - LeetCode Can you solve this real interview question? Check if a String Is an Acronym of Words - Given an array of strings words and a string s, determine if s is an acronym of words. The string s is considered an acronym of words if it can be formed by concatenatin leetc.. 2023. 12. 28.
leetcode 2928. Distribute Candies Among Children I https://leetcode.com/problems/distribute-candies-among-children-i/ Distribute Candies Among Children I - LeetCode Can you solve this real interview question? Distribute Candies Among Children I - You are given two positive integers n and limit. Return the total number of ways to distribute n candies among 3 children such that no child gets more than limit candies. leetcode.com 1 2 3 4 5 6 7 8 9 .. 2023. 12. 27.
leetcode CodeTestcaseTestcaseTest Result2942. Find Words Containing Character https://leetcode.com/problems/find-words-containing-character/description/ Find Words Containing Character - LeetCode Can you solve this real interview question? Find Words Containing Character - You are given a 0-indexed array of strings words and a character x. Return an array of indices representing the words that contain the character x. Note that the returned array m leetcode.com 123456789c.. 2023. 12. 27.