
Question 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. 음이 아닌 정수 x가 주어졌을 때, 제곱근 x를 구하여라. 다만 제곱근 x를 구할 때 소수점 아래수는 버린다. Note: 내장 함수를 사용하면 안 ..

Question Implement pow(x, n), which calculates x raised to the power n (i.e., xn). x의 n승을 리턴하는 pow 함수를 구현하라. 제약사항 -100.0 < x < 100.0 -2^31 = 1; } } if (n < 0) { ans = (double)(1.0) / (double)(ans); } return ans; } }; // 해당 문제의 Discuss 참고 출처 : https://leetcode.com/explore/interview/card/top-interview-questions-medium/113/math/818/ Explore - LeetCode LeetCode Explore is the best place for everyone..

Question Given a string columnTitle that represents the column title as appears in an Excel sheet, return its corresponding column number. Excel 시트에 나타나는 열 제목을 나타내는 문자열 columnTitle이 주어지면 해당 열 번호를 반환합니다. 제약사항 1 27 ~ 702, 총 676개 = 26²개 3자리 수 => 703 ~ 18278, 총 17576개 = 26³ 그렇다면 26개의 단위로 column number를 확인할 수 있을 것 같다. 예를 들어, a = 1 b = 2 c = 3 "ABC" 라면 'C' = 'C' - 'A' + 1 'B' = ('B' - 'A' + 1) * 26; '..

Question Write an algorithm to determine if a number n is happy. A happy number is a number defined by the following process: Starting with any positive integer, replace the number by the sum of the squares of its digits. Repeat the process until the number equals 1 (where it will stay), or it loops endlessly in a cycle which does not include 1. Those numbers for which this process ends in 1 are..

Question Given an integer n, return the number of trailing zeroes in n!. integer 변수 n이 주어졌을 때, n 팩토리얼의 traling zeros 숫자 개수를 리턴하라. trailing zero란 일의 자리수 부터 있는 0의 개수이다. 예를 들어, 12300 이면 trailing zero는 2이다. 다만 중간에 0이 나오는 것은 trailing zero는 아니다. 예를 들어, 1200300의 trailing zero는 2이다. Note that n! = n * (n - 1) * (n - 2) *... * 3 * 2 * 1. 제약사항 0

reference : https://google.github.io/styleguide/ Google Style Guides Style guides for Google-originated open-source projects google.github.io 구글에서 제시하는 C/C++ 코드스타일(네이밍 룰)을 알아본다 1. Class/Struct Class의 이름은 Pascal Case를 사용한다. Class의 멤버함수 또한 Pascal Case를 사용한다 Class의 멤버함수안의 일반 변수들은 Snake Case를 사용한다. class MyClass { public: int CountFooErrors(const std::vector& foos) { int total_number_of_foo_errors =..

Question Given an array of intervals where intervals[i] = [starti, endi], merge all overlapping intervals, and return an array of the non-overlapping intervals that cover all the intervals in the input. 구간의 시작점과 끝점 정보가 담긴 배열들을 담고있는 배열이 주어졌을 때, 겹치는 구간을 모두 합쳐, 겹치는 구간이 없게 반환하라. 제약사항 1

Question Given a string s, return the longest palindromic substring in s. 문자열 s가 주어졌을 때, 가장 긴 palindromic 부분 문자열을 출력하라 제약사항 1 = 0; i--) { for (int j = i; j longest_length) { longest_length = j - i + 1; longest_substring = s.substr(i..
- Total
- Today
- Yesterday
- Medium
- DP
- 인터뷰
- 트리
- coding interview
- 러스트
- 맛집
- 러스트 입문
- 솔직후기
- rust
- 속초 맛집
- 알고리즘
- 러스트 기초
- Interview
- 반드시 알아야 할 자료구조
- 기술면접
- 러스트 배우기
- 내돈내산
- 속초
- algorithm
- Tree
- 자료구조
- 코딩인터뷰
- LeetCode
- 리트코드
- interview question
- C++
- PS
- ProblemSolving
- Problem Solving
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |