본문 바로가기

분류 전체보기1523

leetcode 2769. Find the Maximum Achievable Number https://leetcode.com/problems/find-the-maximum-achievable-number/description/ - LeetCode Can you solve this real interview question? - You are given two integers, num and t. An integer x is called achievable if it can become equal to num after applying the following operation no more than t times: * Increase or decrease x by 1, and simultaneou leetcode.com 1 2 3 class Solution: def theMaximumAch.. 2023. 7. 13.
leetcode 2739. Total Distance Traveled https://leetcode.com/problems/total-distance-traveled/description/ Total Distance Traveled - LeetCode Can you solve this real interview question? Total Distance Traveled - A truck has two fuel tanks. You are given two integers, mainTank representing the fuel present in the main tank in liters and additionalTank representing the fuel present in the addition leetcode.com 1 2 3 4 5 6 7 8 9 10 11 12.. 2023. 7. 7.
leetcode 2651. Calculate Delayed Arrival Time https://leetcode.com/problems/calculate-delayed-arrival-time/description/ Calculate Delayed Arrival Time - LeetCode Can you solve this real interview question? Calculate Delayed Arrival Time - You are given a positive integer arrivalTime denoting the arrival time of a train in hours, and another positive integer delayedTime denoting the amount of delay in hours. Return leetcode.com 1 2 3 class S.. 2023. 7. 6.
leetcode 2544. Alternating Digit Sum https://leetcode.com/problems/alternating-digit-sum/description/ Alternating Digit Sum - LeetCode Can you solve this real interview question? Alternating Digit Sum - You are given a positive integer n. Each digit of n has a sign according to the following rules: * The most significant digit is assigned a positive sign. * Each other digit has an opposit leetcode.com 1 2 3 4 5 6 7 8 9 10 11 class .. 2023. 7. 3.
leetcode 2595. Number of Even and Odd Bits https://leetcode.com/problems/number-of-even-and-odd-bits/description/ Number of Even and Odd Bits - LeetCode Can you solve this real interview question? Number of Even and Odd Bits - You are given a positive integer n. Let even denote the number of even indices in the binary representation of n (0-indexed) with value 1. Let odd denote the number of odd indices in leetcode.com 1 2 3 4 5 6 7 8 9 .. 2023. 6. 27.
leetcode 2716. Minimize String Length https://leetcode.com/problems/minimize-string-length/description/ Minimize String Length - LeetCode Can you solve this real interview question? Minimize String Length - Given a 0-indexed string s, repeatedly perform the following operation any number of times: * Choose an index i in the string, and let c be the character in position i. Delete the closest leetcode.com 1 2 3 4 5 class Solution: de.. 2023. 6. 27.
leetcode 2710. Remove Trailing Zeros From a String https://leetcode.com/problems/remove-trailing-zeros-from-a-string/description/ Remove Trailing Zeros From a String - LeetCode Can you solve this real interview question? Remove Trailing Zeros From a String - Given a positive integer num represented as a string, return the integer num without trailing zeros as a string. Example 1: Input: num = "51230100" Output: "512301" Explan leetcode.com 1 2 3.. 2023. 6. 26.
leetcode 2656. Maximum Sum With Exactly K Elements https://leetcode.com/problems/maximum-sum-with-exactly-k-elements/description/ Maximum Sum With Exactly K Elements - LeetCode Can you solve this real interview question? Maximum Sum With Exactly K Elements - You are given a 0-indexed integer array nums and an integer k. Your task is to perform the following operation exactly k times in order to maximize your score: 1. Select an e leetcode.com 1 .. 2023. 6. 26.
leetcode 35. Search Insert Position https://leetcode.com/problems/search-insert-position/description/?envType=study-plan-v2&envId=top-interview-150 Search Insert Position - LeetCode Can you solve this real interview question? Search Insert Position - Given a sorted array of distinct integers and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order. You mus.. 2023. 6. 26.
leetcode 172. Factorial Trailing Zeroes https://leetcode.com/problems/factorial-trailing-zeroes/description/?envType=study-plan-v2&envId=top-interview-150 Factorial Trailing Zeroes - LeetCode Can you solve this real interview question? Factorial Trailing Zeroes - Given an integer n, return the number of trailing zeroes in n!. Note that n! = n * (n - 1) * (n - 2) * ... * 3 * 2 * 1. Example 1: Input: n = 3 Output: 0 Explanation: 3! = 6,.. 2023. 6. 26.
leetcode 9. Palindrome Number https://leetcode.com/problems/palindrome-number/description/?envType=study-plan-v2&envId=top-interview-150 Palindrome Number - LeetCode Can you solve this real interview question? Palindrome Number - Given an integer x, return true if x is a palindrome, and false otherwise. Example 1: Input: x = 121 Output: true Explanation: 121 reads as 121 from left to right and from right to left. Ex leetcode.. 2023. 6. 26.
백준 1152 단어의 개수 https://www.acmicpc.net/problem/1152 1152번: 단어의 개수 첫 줄에 영어 대소문자와 공백으로 이루어진 문자열이 주어진다. 이 문자열의 길이는 1,000,000을 넘지 않는다. 단어는 공백 한 개로 구분되며, 공백이 연속해서 나오는 경우는 없다. 또한 문자열 www.acmicpc.net 1 2 3 s = input() print(len(s.split())) cs 2023. 6. 24.