본문 바로가기

python-algorithm1402

leetcode 2348. Number of Zero-Filled Subarrays https://leetcode.com/problems/number-of-zero-filled-subarrays/description/ Number of Zero-Filled Subarrays - LeetCode Can you solve this real interview question? Number of Zero-Filled Subarrays - Given an integer array nums, return the number of subarrays filled with 0. A subarray is a contiguous non-empty sequence of elements within an array. Example 1: Input: nums = leetcode.com 1 2 3 4 5 6 7 .. 2023. 3. 21.
leetcode 1009. Complement of Base 10 Integer https://leetcode.com/problems/complement-of-base-10-integer/description/ Complement of Base 10 Integer - LeetCode Can you solve this real interview question? Complement of Base 10 Integer - The complement of an integer is the integer you get when you flip all the 0's to 1's and all the 1's to 0's in its binary representation. * For example, The integer 5 is "101" in b leetcode.com 1 2 3 4 5 6 7 .. 2023. 3. 20.
leetcode 2553. Separate the Digits in an Array https://leetcode.com/problems/separate-the-digits-in-an-array/description/ Separate the Digits in an Array - LeetCode Can you solve this real interview question? Separate the Digits in an Array - Given an array of positive integers nums, return an array answer that consists of the digits of each integer in nums after separating them in the same order they appear in nums. leetcode.com 1 2 3 4 5 6.. 2023. 3. 14.
leetcode 1122. Relative Sort Array https://leetcode.com/problems/relative-sort-array/description/ Relative Sort Array - LeetCode Can you solve this real interview question? Relative Sort Array - Given two arrays arr1 and arr2, the elements of arr2 are distinct, and all elements in arr2 are also in arr1. Sort the elements of arr1 such that the relative ordering of items in arr1 are t leetcode.com 1 2 3 4 5 6 7 8 9 class Solution: .. 2023. 3. 13.
leetcode 2395. Find Subarrays With Equal Sum https://leetcode.com/problems/find-subarrays-with-equal-sum/description/ Find Subarrays With Equal Sum - LeetCode Can you solve this real interview question? Find Subarrays With Equal Sum - Given a 0-indexed integer array nums, determine whether there exist two subarrays of length 2 with equal sum. Note that the two subarrays must begin at different indices. Return tr leetcode.com 1 2 3 4 5 6 7 .. 2023. 3. 13.
백준 27866 문자와 문자열 https://www.acmicpc.net/problem/27866 27866번: 문자와 문자열 첫째 줄에 영어 소문자와 대문자로만 이루어진 단어 $S$가 주어진다. 단어의 길이는 최대 $1\,000$이다. 둘째 줄에 정수 $i$가 주어진다. ($1 \le i \le \left|S\right|$) www.acmicpc.net 1 2 3 4 5 6 7 8 9 def sol(s, i) -> str: return s[i-1] if __name__ == '__main__': s = input() i = int(input()) print(sol(s, i)) cs 2023. 3. 13.
leetcode 2451. Odd String Difference https://leetcode.com/problems/odd-string-difference/description/ Odd String Difference - LeetCode Can you solve this real interview question? Odd String Difference - You are given an array of equal-length strings words. Assume that the length of each string is n. Each string words[i] can be converted into a difference integer array difference[i] of len leetcode.com 1 2 3 4 5 6 7 8 9 10 11 12 13 .. 2023. 3. 8.
leetcode 2264. Largest 3-Same-Digit Number in String https://leetcode.com/problems/largest-3-same-digit-number-in-string/description/ Largest 3-Same-Digit Number in String - LeetCode Can you solve this real interview question? Largest 3-Same-Digit Number in String - You are given a string num representing a large integer. An integer is good if it meets the following conditions: * It is a substring of num with length 3. * It consists of leetcode.co.. 2023. 3. 7.
leetcode 2549. Count Distinct Numbers on Board https://leetcode.com/problems/count-distinct-numbers-on-board/description/ Count Distinct Numbers on Board - LeetCode Can you solve this real interview question? Count Distinct Numbers on Board - You are given a positive integer n, that is initially placed on a board. Every day, for 109 days, you perform the following procedure: * For each number x present on the board, f leetcode.com 1 2 3 4 5 .. 2023. 3. 7.
leetcode 1539. Kth Missing Positive Number https://leetcode.com/problems/kth-missing-positive-number/description/ Kth Missing Positive Number - LeetCode Can you solve this real interview question? Kth Missing Positive Number - Given an array arr of positive integers sorted in a strictly increasing order, and an integer k. Return the kth positive integer that is missing from this array. Example 1: Input: leetcode.com 1 2 3 4 5 6 7 8 9 10 .. 2023. 3. 6.
leetcode 2164. Sort Even and Odd Indices Independently https://leetcode.com/problems/sort-even-and-odd-indices-independently/description/ Sort Even and Odd Indices Independently - LeetCode Can you solve this real interview question? Sort Even and Odd Indices Independently - You are given a 0-indexed integer array nums. Rearrange the values of nums according to the following rules: 1. Sort the values at odd indices of nums in non-increasing o leetcod.. 2023. 3. 3.
leetcode 203. Remove Linked List Elements https://leetcode.com/problems/remove-linked-list-elements/description/ Remove Linked List Elements - LeetCode Can you solve this real interview question? Remove Linked List Elements - Given the head of a linked list and an integer val, remove all the nodes of the linked list that has Node.val == val, and return the new head. Example 1: [https://assets.leetcode. leetcode.com 1 2 3 4 5 6 7 8 9 10 .. 2023. 2. 28.