목록퀘스천 (18)
코딩 공부

[LeetCode] [Easy] 1417. Reformat The String leetcode.com/problems/reformat-the-string/ Reformat The String - 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 문자열 변경하기 문자열속에 나온 문자와 숫자를 번갈아가면서 나오도록 바꿔서 리턴하는게 문제에요. 조합이 나올수 없다면 빈 문자열을 리턴해주세요. 문자열에 있는 문자와 숫자를 나눠서 저장해두고 길이가 2 이상 차이나면 맞는 조..

[LeetCode] [Easy] 693. Binary Number with Alternating Bits leetcode.com/problems/binary-number-with-alternating-bits/ Binary Number with Alternating Bits - 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 이진수 매번 0, 1 바뀌는지 확인하기 이진수로 변환했을때 인접한 두 수가 같지 않는지 확인하는 함수를 만드는 문제에요. 예를들어 5는 이진..

[LeetCode] [Easy] 1464. Maximum Product of Two Elements in an Array leetcode.com/problems/maximum-product-of-two-elements-in-an-array/ Maximum Product of Two Elements in an 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 배열 안 가장 큰 두수 곱하기 작은수부터 큰수로 정렬해서 마지막 두 수를 곱하면 될것 같아요. ..

[LeetCode] [Easy] 1572. Matrix Diagonal Sum leetcode.com/problems/matrix-diagonal-sum/ Matrix Diagonal Sum - 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 2D 대각선 합 구하기 쉽게 생각할수 있는건 nested for loop을 돌려서 각각의 위치를 더해주는건데 생각보다 더 복잡해 질것 같아요. 그래서 한번의 for loop으로도 합을 구하는 방법을 찾아봤어요. 대각선은 항상..

[LeetCode] [Easy] 1389. Create Target Array in the Given Order leetcode.com/problems/create-target-array-in-the-given-order/ Create Target Array in the Given Order - 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 주어진 숫자 배열을 주어진 인댁스 자리에 넣기 같은 인댁스에 넣을경우 기존에 있던 숫자는 오른쪽으로 밀려야해요. List에..

[LeetCode] [Easy] 1528. Shuffle String leetcode.com/problems/shuffle-string/ Shuffle String - 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 문자열 셔플 주어진 인텍스 배열과 문자열을 가지고 아래 두줄의 결과값을 구하는 문제에요. 캐릭터 배열에 자리에 맞는 캐릭터를 넣고 마지막에 문자열로 바꿔서 리턴

[LeetCode] [Easy] 1323. Maximum 69 Number leetcode.com/problems/maximum-69-number/ Maximum 69 Number - 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 6, 9 바꿔서 가장 큰 수 만들기 6과 9로만 이루어진 수가 주어질 때 6이면 9로 9면 6으로 한번만 바꿀수 있는 최대값을 구하는 문제입니다. char 배열로 숫자를 넣어주고 for loop을 돌려 처음 6을 찾으면 9로 바꿔주고 ..

[LeetCode] [Easy] 1446. Consecutive Characters leetcode.com/problems/consecutive-characters/ Consecutive Characters - 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 가장 많이 연속된 캐릭터 찾기 for loop을 돌면서 전 캐릭터와 같은지 비교하고 같으면 max 값을 업데이트해주면 끝 (다르면 초기화) 비교적 쉬웠던 문제였어요 ㅎㅎ

[LeetCode] [Easy] 1480. Running Sum of 1d Array leetcode.com/problems/running-sum-of-1d-array/ Running Sum of 1d 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 RunningSum 구하기 처음부터 현재 인덱스까지 합이 Running Sum 이라네요. running sum[i] = nums[0]+ nums[1] + ... + nums[i] for loop을 돌면서..

[LeetCode] [Easy] 171. Excel Sheet Column Title leetcode.com/problems/excel-sheet-column-title/ Excel Sheet Column Title - 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 엑셀 Column Title 계산하기 첫번째는 A, 두번째는 B, ... ,26번째는 Z, 27번째는 AA 이런 방식으로 주어진 수(n번째)에 맞는 문자열을 찾아봅시다. 알파벳이 26개가 있으니 26..