노트(211)
-
[leetcode] 77. Combinations
77. Combinations Companies Given two integers n and k, return all possible combinations of k numbers chosen from the range [1, n]. You may return the answer in any order. Example 1: Input: n = 4, k = 2 Output: [[1,2],[1,3],[1,4],[2,3],[2,4],[3,4]] Explanation: There are 4 choose 2 = 6 total combinations. Note that combinations are unordered, i.e., [1,2] and [2,1] are considered to be the same co..
2023.02.06 -
[알림] 파이썬으로 슬랙에 알림 메시지 보내기 (send messge to slack using python)
1. 슬랙에 Incoming WebHooks 앱 추가 2. 포스트할 채널 선택 -> 보낼상대 (내이름) or 채널 선택하면 됌 3. url 저장 4. 메세지 전송 코드import json import sys import requests url = "웹후크URL" title = ("New Incoming Message :zap:") message = ("Train완료!") slack_data = { "username" : "NotificationBot", "icon_emoji" : ":satellite:", "attachments" : [ { "color" : "#9733EE", "fields" : [ { "title" : title, "value" : message, "short" : "false", }..
2023.01.06 -
[leetcode] 17. Letter Combinations of a Phone Number
Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent. Return the answer in any order. A mapping of digits to letters (just like on the telephone buttons) is given below. Note that 1 does not map to any letters. Example 1: Input: digits = "23" Output: ["ad","ae","af","bd","be","bf","cd","ce","cf"] Example 2: Input: digits = "..
2023.01.03 -
[leetcode] 200. Number of Islands
Given an m x n 2D binary grid grid which represents a map of '1's (land) and '0's (water), return the number of islands. An island is surrounded by water and is formed by connecting adjacent lands horizontally or vertically. You may assume all four edges of the grid are all surrounded by water. Example 1: Input: grid = [ ["1","1","1","1","0"], ["1","1","0","1","0"], ["1","1","0","0","0"], ["0","..
2023.01.02 -
[leetcode] 347. Top K Frequent Elements
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
2022.12.20 -
[leetcode] 3. Longest Substring Without Repeating Characters
Given a string s, find the length of the longest substring without repeating characters. Example 1: Input: s = "abcabcbb" Output: 3 Explanation: The answer is "abc", with the length of 3. Example 2: Input: s = "bbbbb" Output: 1 Explanation: The answer is "b", with the length of 1. Example 3: Input: s = "pwwkew" Output: 3 Explanation: The answer is "wke", with the length of 3. Notice that the ans..
2022.12.19