본문 바로가기

스터디 공간71

[Python-Leetcode] 1. Two Sum (difficulty : Easy - ☆) 문제설명 Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target. You may assume that each input would have exactly one solution, and you may not use the same element twice. You can return the answer in any order. Example 1: Input: nums = [2,7,11,15], target = 9 Output: [0,1] Explanation: Because nums[0] + nums[1] == 9, we return [0, 1.. 2022. 5. 1.
[Python-Leetcode] 2. Add Two Numbers (difficulty : Medium - ☆☆) 문제 설명 2. Add Two Numbers You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order, and each of their nodes contains a single digit. Add the two numbers and return the sum as a linked list. You may assume the two numbers do not contain any leading zero, except the number 0 itself. Example 1: Input: l1 = [2,4,3], l2 = [5,6,4] Output: [.. 2022. 4. 30.
[Python-Leetcode] 9. Palindrome Number (difficulty : Easy - ☆) 문제 설명 Given an integer x, return true if x is palindrome integer. An integer is a palindrome when it reads the same backward as forward. For example, 121 is a palindrome while 123 is not. Example 1: Input: x = 121 Output: true Explanation: 121 reads as 121 from left to right and from right to left. Example 2: Input: x = -121 Output: false Explanation: From left to right, it reads -121. From righ.. 2022. 4. 27.
[Python-Leetcode] 4. Median of Two Sorted Arrays (difficulty : Hard - ☆☆☆) 문제 설명 Given two sorted arrays nums1 and nums2 of size m and n respectively, return the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)). Example 1: Input: nums1 = [1,3], nums2 = [2] Output: 2.00000 Explanation: merged array = [1,2,3] and median is 2. Example 2: Input: nums1 = [1,2], nums2 = [3,4] Output: 2.50000 Explanation: merged array = [1,2,3,4] and med.. 2022. 4. 27.
[sklearn] Data Scaling (Standard / minmax / maxabs / Robust) Data Scaling¶ 학습에 사용될 데이터를 단위 통일화시키는 작업 서로 다른 단위나 값의 크기를 가지는 컬럼별 데이터들의 분포나 단위를 일정하게 통일하는 작업 Standard Scaling Min-Max Scaling Max-Abs Scaling Robust Scailing In [8]: # 1. Standard Scaling # 평균 0, 표준편차 1로 데이터를 변화 (표준정규화) # (X-μ) / σ from IPython.core.display import display, HTML display(HTML("")) from sklearn.preprocessing import StandardScaler import numpy as np import matplotlib.pyplot as plt im.. 2022. 2. 27.
[Python-Leetcode] 232. Implement Queue using Stacks (difficulty : Easy - ☆) 문제 설명 Implement a first in first out (FIFO) queue using only two stacks. The implemented queue should support all the functions of a normal queue (push, peek, pop, and empty). Implement the MyQueue class: void push(int x) Pushes element x to the back of the queue. int pop() Removes the element from the front of the queue and returns it. int peek() Returns the element at the front of the queue. b.. 2021. 8. 12.