반응형 leetcode18 [MySQL/Oracle] 1741. Find Total Time Spent by Each Employee 목차 문제 Table: Employees +-------------+------+ | Column Name | Type | +-------------+------+ | emp_id | int | | event_day | date | | in_time | int | | out_time | int | +-------------+------+ (emp_id, event_day, in_time) is the primary key of this table. The table shows the employees' entries and exits in an office. event_day is the day at which this event happened, in_time is the minute at which .. 코딩테스트/SQL 문제풀이 2022. 11. 8. [JAVA] 409. Longest Palindrome 목차 문제 Given a string s which consists of lowercase or uppercase letters, return the length of the longest palindrome that can be built with those letters. Letters are case sensitive, for example, "Aa" is not considered a palindrome here. Example 1: Input: s = "abccccdd" Output: 7 Explanation: One longest palindrome that can be built is "dccaccd", whose length is 7. Example 2: Input: s = "a" Outp.. 코딩테스트/알고리즘 문제풀이 2022. 11. 8. [JAVA] 121. Best Time to Buy and Sell Stock 목차 문제 You are given an array prices where prices[i] is the price of a given stock on the ith day. You want to maximize your profit by choosing a single day to buy one stock and choosing a different day in the future to sell that stock. Return the maximum profit you can achieve from this transaction. If you cannot achieve any profit, return 0. Example 1: Input: prices = [7,1,5,3,6,4] Output: 5 Ex.. 코딩테스트/알고리즘 문제풀이 2022. 11. 8. [JAVA] 876. Middle of the Linked List 목차 문제 Given the head of a singly linked list, return the middle node of the linked list. If there are two middle nodes, return the second middle node. Example 1: Input: head = [1,2,3,4,5] Output: [3,4,5] Explanation: The middle node of the list is node 3. Example 2: Input: head = [1,2,3,4,5,6] Output: [4,5,6] Explanation: Since the list has two middle nodes with values 3 and 4, we return the sec.. 코딩테스트/알고리즘 문제풀이 2022. 10. 15. [JAVA] 392. Is Subsequence 목차 문제 Given two strings s and t, return true if s is a subsequence of t, or false otherwise. A subsequence of a string is a new string that is formed from the original string by deleting some (can be none) of the characters without disturbing the relative positions of the remaining characters. (i.e., "ace" is a subsequence of "abcde" while "aec" is not). Example 1: Input: s = "abc", t = "ahbgdc".. 코딩테스트/알고리즘 문제풀이 2022. 10. 12. [JAVA] 69. Sqrt(x) 목차 문제 Given a non-negative integer x, compute and return the square root of x. Since the return type is an integer, the decimal digits are truncated, and only the integer part of the result is returned. Note: You are not allowed to use any built-in exponent function or operator, such as pow(x, 0.5) or x ** 0.5. Example 1: Input: x = 4 Output: 2 Example 2: Input: x = 8 Output: 2 Explanation: The .. 코딩테스트/알고리즘 문제풀이 2022. 9. 16. 이전 1 2 다음 반응형