Computer Science (11) 썸네일형 리스트형 Chapter 1. Basic C and Algorithm Let look at this code snipset #include int main(void) { int a , b , c; int max; printf("Getting a max value of 3"); printf("a: "); scanf("%d", &a); printf("b: "); scanf("%d", &b); printf("c: "); scanf("%d", &c); max = a; if(b > max) max = b; if(c > max) max = c; prinft("Max value is %d", max); return 0; } scanf need to use & (Ampersand) .. Lets not go super deep at this point but..! Lets think s.. Leetcode #217. Contains Duplicate Python set 의 특성을 잘 알고 있으면 상당히 쉽게 풀 수 있다. It is easy if you understand set in python. But I was not at the moment so I used Brute force way to solve this problem Brute force class Solution(object): def containsDuplicate(self, nums): """ :type nums: List[int] :rtype: bool """ count = 0 nums.sort() for i in range(len(nums)-1): if nums[i] == nums[i+1]: return True return False As you can see time co.. Leetcode #20. Valid Parentheses Leetcode 20. Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. An input string is valid if: Open brackets must be closed by the same type of brackets. Open brackets must be closed in the correct order. Every close bracket has a corresponding open bracket of the same type. Example 1: Input: s = "()" Output: true Example 2: Inp.. 이전 1 2 다음