본문 바로가기
반응형

Software Development/Leetcode33

Leetcode 125. Valid Palindrome 125. Valid Palindrome 오늘은 릿코드 125번 문제 Valid Palindrome 을 풀어보겠습니다. 문제설명 팔린드롬 이란 알파벳 소문자 대문자는 관계없이 문자열이 앞에서부터 읽은 것과 뒤에서부터 읽은 것이 같은 문자열을 말합니다. 아래 예시에서 볼 수 있듯이, 스페이스, 콜론, 반점 등과 같은 Non-alphanumeric 은 모두 제외하고 숫자 혹은 문자만으로 비교를 합니다. Easy A phrase is a palindrome if, after converting all uppercase letters into lowercase letters and removing all non-alphanumeric characters, it reads the same forward and ba.. 2023. 1. 19.
Leetcode 128. Longest Consecutive Sequence 릿코드 128번문제 Longest Consecutive Sequence 자바스크립트로 Leetcode 128 번문제인 Longest ... 를 풀어보겠습니다. 난이도 - 중 문제설명 Medium Companies Given an unsorted array of integers nums, return the length of the longest consecutive elements sequence. You must write an algorithm that runs in O(n) time. Example 1: Input: nums = [100,4,200,1,3,2] Output: 4 Explanation: The longest consecutive elements sequence is [1, 2, 3, .. 2023. 1. 19.
Leetcode 271. Encode and Decode Strings 271. Encode and Decode Strings 오늘은 릿코드 271번 문제 Encode and Decode Strings 를 풀어보겠습니다. 난이도 - 중 문제설명 Design an algorithm to encode a list of strings to a string. The encoded string is then sent over the network and is decoded back to the original list of strings. Machine 1 (sender) has the function: string encode(vector strs) { // ... your code return encoded_string; } Machine 2 (receiver) has the f.. 2023. 1. 19.
Leetcode 238. Product of Array Except Self 238. Product of Array Except Self 오늘은 릿코드 238번문제입니다. 난이도 - 중 문제설명 Medium 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. Exampl.. 2023. 1. 19.
Leetcode 347. Top K Frequent Elements 오늘은 릿코드 347번 문제(Top K Frequent Elements)를 풀어보도록 하겠습니다. Medium Given an integer array nums and an integer k, return the k most frequent elements. You may return the answer in any order. Example 1: Input: nums = [1,1,1,2,2,3], k = 2 Output: [1,2] Example 2: Input: nums = [1], k = 1 Output: [1] Constraints: 1 2023. 1. 15.
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.. 2023. 1. 14.
반응형