분류 전체보기

    [LeetCode] 557. Reverse Words in a String III

    557. Reverse Words in a String III Easy Given a string s, reverse the order of characters in each word within a sentence while still preserving whitespace and initial word order. Example 1: Input: s = "Let's take LeetCode contest" Output: "s'teL ekat edoCteeL tsetnoc" Example 2: Input: s = "God Ding" Output: "doG gniD" Constraints: 1 str: result = split(' ', s) result = ' '.join([word[::-1] for ..

    [LeetCode]1338. Reduce Array Size to The Half

    1338. Reduce Array Size to The Half Medium You are given an integer array arr. You can choose a set of integers and remove all the occurrences of these integers in the array. Return the minimum size of the set so that at least half of the integers of the array are removed. Example 1: Input: arr = [3,3,3,3,5,5,5,2,2,7] Output: 2 Explanation: Choosing {3,7} will make the new array [5,5,5,2,2] whic..

    [머신러닝 시스템 디자인 스터디 Part5] Performance and Capacity Considerations

    [머신러닝 시스템 디자인 스터디 Part5] Performance and Capacity Considerations

    Performance and Capacity Considerations (성능과 공간 고려사항) 머신러닝 시스템을 위한 복잡성 고려 훈련의 비교와 복잡성 평가 분석 대규모 시스템에서의 성능과 공간 고려 계층, 깔때기 기반 모델링 접근 머신 러닝 기반의 시스템에 관련 한 작업에서 목표는 일반적으로 성능과 공간 요구조건을 만족시키면서 메트릭스들 (참여율, 등)을 향상시키는 것이다. 두가지 머신러닝 시스템 구축 단계에서 중요한 성능과 공간의 토론이 나타난다. 훈련 시간: 얼마나 많은 훈련 데이터와 공간이 Predictor 를 구축하는데 필요한가? 평가 시간: Service level agreement (SLA) 이 무엇인가? 머신 러닝 모델 기술을 선택하는 것으로 그 시스템을 구축하는 과정 결정을 사용하고 훈..

    [LeetCode] 1570. Dot Product of Two Sparse Vectors

    1570. Dot Product of Two Sparse Vectors Medium Given two sparse vectors, compute their dot product. Implement class SparseVector: SparseVector(nums) Initializes the object with the vector nums dotProduct(vec) Compute the dot product between the instance of SparseVector and vec A sparse vector is a vector that has mostly zero values, you should store the sparse vector efficiently and compute the ..

    [LeetCode] 28. Implement strStr()

    28. Implement strStr() Easy Implement strStr(). Given two strings needle and haystack, return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. Clarification: What should we return when needle is an empty string? This is a great question to ask during an interview. For the purpose of this problem, we will return 0 when needle is an empty string. Th..

    [LeetCode] 49. Group Anagrams

    49. Group Anagrams Medium Given an array of strings strs, group the anagrams together. You can return the answer in any order. An Anagram is a word or phrase formed by rearranging the letters of a different word or phrase, typically using all the original letters exactly once. Example 1: Input: strs = ["eat","tea","tan","ate","nat","bat"] Output: [["bat"],["nat","tan"],["ate","eat","tea"]] Examp..

    [LeetCode] 804. Unique Morse Code Words

    804. Unique Morse Code Words Easy International Morse Code defines a standard encoding where each letter is mapped to a series of dots and dashes, as follows: 'a' maps to ".-", 'b' maps to "-...", 'c' maps to "-.-.", and so on. For convenience, the full table for the 26 letters of the English alphabet is given below: [".-","-...","-.-.","-..",".","..-.","--.","....","..",".---","-.-",".-..","--"..

    [LeetCode] 5. Longest Palindromic Substring

    5. Longest Palindromic Substring Medium Given a string s, return the longest palindromic substring in s. Example 1: Input: s = "babad" Output: "bab" Explanation: "aba" is also a valid answer. Example 2: Input: s = "cbbd" Output: "bb" Constraints: 1 = 0 and r self.res_cnt: self.res_cnt = ans self.res = s[l + 1 : r] for i in range(le..