일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 31 |
- mysql
- topic
- 기초
- 그랑사가
- while
- 등차수열
- MSG
- 오늘도 우라라
- 반복문
- 오늘도 우라라 펫 공략
- C++
- mariaDB
- 환경설정
- LeetCode
- Subscribe
- 프로그래밍
- ubuntu
- Linux
- publish
- ros
- 리눅스
- 마리아 DB
- 우분투
- C언어
- 토픽
- 데이터 베이스
- install opencv-4.4.0 on ubuntu 22.04
- 오늘도 우라라 펫
- 오늘도 우라라 공략
- JungOl
- Today
- Total
목록Coding Test (41)
하루의 쉼터
| 두뇌 회전을 위한 문제 풀이 232.함수3_형성평가2_재귀함수 Question : 자연수 N을 입력받아 N이 홀수인 경우에는 1부터 N까지의 홀수를 짝수인 경우는 2부터 N까지의 짝수를 모두 출력하는 프로그램을 재귀함수로 작성하시오. Input : 15 Ouput : 1 3 5 7 9 11 13 15 OR Input : 8 Output : 2 4 6 8 Solution.h class Solution { private: int user_data; int check_data; void input_data(); void recursion(int lp_data,int max_data); public : Solution(); void run(); }; Solution.cpp void Solution::inpu..
| 두뇌 회전을 위한 문제 풀이 588. 함수3-자가진단 2 Question : 자연수 N을 입력받아 재귀함수를 이용하여 N부터 1까지 차례대로 출력하는 프로그램을 작성하시오. N은 50이하의 자연수이다. Input : 5 Output : 5 4 3 2 1 Solution.h class Solution { private: int user_data; void input_data(); void recursion(int data); public : Solution(); void Run(); }; Solution.cpp #include "Solution.h" Solution::Solution() { user_data = 0; } void Solution::input_data() { std::cout user_d..
Question : Reverse a singly linked list. Exapmle : Input: 1->2->3->4->5->NULL Output: 5->4->3->2->1->NULL Follow up: A linked list can be reversed either iteratively or recursively. Could you implement both? Solution.h #include #include #include struct ListNode { int val; ListNode* next; ListNode() : val(0), next(nullptr) {} ListNode(int x) : val(x), next(nullptr) {} ListNode(int x, ListNode* ne..
Question : Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum. Follow up: If you have figured out the O(n) solution, try coding another solution using the divide and conquer approach, which is more subtle. Example 1: Input: nums = [-2,1,-3,4,-1,2,1,-5,4] Output: 6 Explanation: [4,-1,2,1] has the largest sum = 6...
Question : Merge two sorted linked lists and return it as a new sorted list. The new list should be made by splicing together the nodes of the first two lists. Example 1 : Input: l1 = [1,2,4], l2 = [1,3,4] Output: [1,1,2,3,4,4] Example 2 : Input: l1 = [], l2 = [] Output: [] Example 3 : Input: l1 = [], l2 = [0] Output: [0] Constraints : The number of nodes in both lists is in the range [0, 50] -1..
Question Given a non-empty array of integers nums, every element appears twice except for one. Find that single one. Follow up: Could you implement a solution with a linear runtime complexity and without using extra memory? Example 1: Input: nums = [2,2,1] Output: 1 Example 2: Input: nums = [4,1,2,1,2] Output: 4 Example 3: Input: nums = [1] Output: 1 Constraints: 1
Question : 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. Example 1:Input: s = "()"Output: true Example 2:Input: s = "()[]{}"Output: true Example 3:Input: s = "(]"Output: false Example ..
Question : Given a non-negative integer num, repeatedly add all its digits until the result has only one digit. Input: 38 Output: 2 Explanation: The process is like: 3 + 8 = 11, 1 + 1 = 2. Since 2 has only one digit, return it.Question Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target. You may assume that each input would hav..