본문 바로가기

Algorithm/Leetcode3

8. String to Integer (atoi) - 커스텀 atoi 구현(ascii to int) - c++ 특정 조건을 만족하는 atoi를 직접 구현하는 문제이다 Only the space character ' ' is considered a whitespace character. Assume we are dealing with an environment that could only store integers within the 32-bit signed integer range: [−231, 231 − 1]. If the numerical value is out of the range of representable values, 231 − 1 or −231 is returned. string으로 들어오는 input에서 캐릭터값을 제거하고 부호와 숫자만 남기고 출력한다. 단 32bit int의 범위를 벗어나면 .. 2020. 11. 23.
48. rotate image C++ 풀이 https://leetcode.com/problems/rotate-image [ Rotate Image - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com ](https://leetcode.com/problems/rotate-image/) #include using namespace std; class Solution { public: void rotate(vector& matrix) { int N = matrix.size(); for (int i = 0; i <.. 2020. 11. 17.
26. Remove Duplicates from Sorted Array - C++ 풀이 www.leetcode.com/problems/remove-duplicates-from-sorted-array/ Remove Duplicates from Sorted Array - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com Given sorted array nums, remove the duplicates in-place such that each element appears only once and returns the new length. Do not a.. 2020. 11. 9.