-
최신 글
- VSCode 사설망 원격 개발 구성 2022년 3월 3일
- 유럽 50개국 수도와 공용어 2022년 2월 15일
- 태극기의 의미를 알아보자 2022년 2월 14일
- Dev Lee의 프로그래밍 초급 강의 – 2 2022년 2월 13일
- [ICT 기본지식] Bit, Byte, IP 란? 2022년 2월 13일
최신 댓글
글 목록
- 2022년 3월 (1)
- 2022년 2월 (6)
- 2021년 8월 (1)
- 2021년 2월 (4)
- 2021년 1월 (9)
- 2020년 12월 (8)
- 2020년 11월 (7)
- 2020년 10월 (2)
- 2020년 9월 (8)
- 2020년 8월 (4)
- 2020년 6월 (1)
- 2020년 5월 (15)
- 2020년 4월 (40)
- 2020년 3월 (2)
- 2019년 7월 (2)
- 2019년 6월 (4)
- 2019년 5월 (4)
- 2019년 4월 (8)
- 2019년 3월 (18)
- 2019년 2월 (19)
- 2019년 1월 (1)
- 2018년 7월 (1)
- 2018년 6월 (55)
- 2018년 5월 (14)
- 2018년 4월 (27)
- 2018년 3월 (13)
- 2017년 12월 (5)
- 2017년 11월 (21)
- 2017년 10월 (2)
- 2017년 9월 (1)
- 2016년 12월 (2)
- 2016년 10월 (1)
- 2016년 9월 (3)
- 2016년 8월 (2)
- 2016년 7월 (1)
- 2016년 5월 (2)
- 2016년 4월 (2)
- 2016년 3월 (9)
- 2016년 2월 (10)
- 2016년 1월 (6)
- 2015년 12월 (8)
- 2015년 11월 (5)
- 2015년 10월 (2)
- 2015년 9월 (33)
월간 보관물: 2017 11월
[LeetCode] 70 – Climbing Stairs
problem: https://leetcode.com/problems/climbing-stairs/description/ You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top? Note: Given n will be a positive integer. … 계속 읽기
[LeetCode] 125 – Valid Palindrome
problem: https://leetcode.com/problems/valid-palindrome/description/ Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. For example, “A man, a plan, a canal: Panama” is a palindrome. “race a car” is not a palindrome. Note: Have you consider that the string might … 계속 읽기
[BAEKJOON] 팰린드롬인지 확인하기
problem: https://www.acmicpc.net/problem/10988 문제 알파벳 소문자로만 이루어진 단어가 주어진다. 이 때, 이 단어가 팰린드롬인지 아닌지 확인하는 프로그램을 작성하시오. 팰린드롬이란 앞으로 읽을 때와 거꾸로 읽을 때 똑같은 단어를 말한다. level, noon은 팰린드롬이고, baekjoon, online, judge는 팰린드롬이 아니다. 입력 첫째 줄에 단어가 주어진다. 단어의 … 계속 읽기
[LeetCode] 172 – Factorial Trailing Zeroes
problem: https://leetcode.com/problems/factorial-trailing-zeroes/description/ Given an integer n, return the number of trailing zeroes in n!. Note: Your solution should be in logarithmic time complexity. Credits: Special thanks to @ts for adding this problem and creating all test cases. Code(C++) class Solution { public: int trailingZeroes(int n) { … 계속 읽기
[LeetCode] 119 – Pascal’s Triangle II
problem: https://leetcode.com/problems/pascals-triangle-ii/description/ Given an index k, return the kth row of the Pascal’s triangle. For example, given k = 3, Return [1,3,3,1]. Note: Could you optimize your algorithm to use only O(k) extra space? Code(C++) class Solution { public: vector<int> getRow(int rowIndex) { vector<int> ret(rowIndex+1, 0); ret[0] = … 계속 읽기
[LeetCode] 20 – Valid Parentheses
problem: https://leetcode.com/problems/valid-parentheses/description/ Given a string containing just the characters ‘(‘, ‘)’, ‘{‘, ‘}’, ‘[‘ and ‘]’, determine if the input string is valid. The brackets must close in the correct order, “()” and “()[]{}” are all valid but “(]” and “([)]” are not. Code(C++) class Solution { public: bool isValid(string s) { int sSize = s.size(); … 계속 읽기
[LeetCode] 14 – Longest Common Prefix
problem: https://leetcode.com/problems/longest-common-prefix/description/ Write a function to find the longest common prefix string amongst an array of strings. Code(C++) class Solution { public: string longestCommonPrefix(vector<string>& strs) { if (strs.empty()) return “”; int strsSize = strs.size(); string ret = strs[0]; if (strsSize == … 계속 읽기
[LeetCode] 9 – Palindrome Number
problem: https://leetcode.com/problems/palindrome-number/description/ Determine whether an integer is a palindrome. Do this without extra space. Code(C++) class Solution { public: bool isPalindrome(int x) { if (x < 0 || x != 0 && x % 10 == 0) return false; int sum … 계속 읽기
[LeetCode] 5 – Longest Palindromic Substring
problem: https://leetcode.com/problems/longest-palindromic-substring/ Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000. Example: Input: “babad” Output: “bab” Note: “aba” is also a valid answer. Example: Input: “cbbd” Output: “bb” accepted Code(C++) class Solution … 계속 읽기